File 1400-ftp-Ignore-unexpected-message.patch of Package erlang
From 98b59284a2e25ee5d72cc2f4644d8736e1516621 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin <ingela@erlang.org>
Date: Mon, 21 Feb 2022 16:16:50 +0100
Subject: [PATCH] ftp: Ignore unexpected message
An unexpected timeout message on the FTP control channel was observed
in a real system and could not be associated with anything that was
expected to happen, so we will ignore but info log such unexpected
messages.
---
lib/ftp/src/ftp.erl | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/inets/src/ftp/ftp.erl b/lib/inets/src/ftp/ftp.erl
index 221eac3dac..fbbe49ddef 100644
--- a/lib/inets/src/ftp/ftp.erl
+++ b/lib/inets/src/ftp/ftp.erl
@@ -2178,7 +2178,10 @@ handle_ctrl_result({pos_prel, _}, #state{caller = {transfer_data, Bin}}
%% Default
handle_ctrl_result({Status, _Lines}, #state{client = From} = State)
when From =/= undefined ->
- ctrl_result_response(Status, State, {error, Status}).
+ ctrl_result_response(Status, State, {error, Status});
+handle_ctrl_result(CtrlMsg, #state{caller = undefined} = State) ->
+ logger:log(info, #{protocol => ftp, unexpected_msg => CtrlMsg}),
+ {noreply, State}.
%%--------------------------------------------------------------------------
%% Help functions to handle_ctrl_result
--
2.34.1