File 3221-ftp-Correct-EXIT-handling-and-missing-state-update.patch of Package erlang
From de4187b77571957c41bd761d69997a2c04b6baff Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin <ingela@erlang.org>
Date: Fri, 19 Feb 2021 09:42:36 +0100
Subject: [PATCH 1/3] ftp: Correct 'EXIT' handling and missing state update
---
lib/ftp/src/ftp.erl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/ftp/src/ftp.erl b/lib/ftp/src/ftp.erl
index 53e9976c96..ba2f1e86c5 100644
--- a/lib/ftp/src/ftp.erl
+++ b/lib/ftp/src/ftp.erl
@@ -1136,7 +1136,9 @@ handle_call({_, recv_chunk}, _From, #state{chunk = true,
chunk = false,
client = undefined}};
Data ->
- {reply, Data, State0}
+ {reply, Data, State0#state{caller = undefined,
+ chunk = false,
+ client = undefined}}
end;
handle_call({_, recv_chunk}, _From, #state{chunk = true,
caller = #recv_chunk_closing{dconn_closed = true,
@@ -2327,6 +2329,8 @@ call(GenServer, Msg, Format, Timeout) ->
case (catch gen_server:call(GenServer, Req, Timeout)) of
{ok, Bin} when is_binary(Bin) andalso (Format =:= string) ->
{ok, binary_to_list(Bin)};
+ {'EXIT', _, _} ->
+ {error, eclosed};
{'EXIT', _} ->
{error, eclosed};
Result ->
--
2.26.2