File 3205-ftp-Maybe-handle-unprocessed-chunk-message-before-ac.patch of Package erlang

From c1c7a32a80aae3bcb4a56ad8ef31bfeba7b6af3e Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin <ingela@erlang.org>
Date: Wed, 14 Oct 2020 15:31:16 +0200
Subject: [PATCH 5/6] ftp: Maybe handle unprocessed chunk message before acking
 final chunk

---
 lib/ftp/src/ftp.erl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/ftp/src/ftp.erl b/lib/ftp/src/ftp.erl
index 92d2119945..3941e695f2 100644
--- a/lib/ftp/src/ftp.erl
+++ b/lib/ftp/src/ftp.erl
@@ -1143,7 +1143,7 @@ handle_call({_, recv_chunk}, From, #state{chunk = true,
                                                                       } = R
                                          } = State0) ->
     State = activate_data_connection(State0),
-    {reply, ok, State#state{client = From, caller = R#recv_chunk_closing{client_called_us=true}}};
+    {noreply, State#state{client = From, caller = R#recv_chunk_closing{client_called_us=true}}};
 
 handle_call({_, recv_chunk}, From, #state{chunk = true,
                                           caller = #recv_chunk_closing{} = R
@@ -1302,6 +1302,13 @@ handle_info({Cls, Socket}, #state{dsock = {Trpt,Socket},
                           caller = #recv_chunk_closing{dconn_closed     =  true,
                                                        client_called_us =  Client =/= undefined}
                          }};
+handle_info({Cls, Socket}, #state{dsock = {Trpt,Socket},
+                                  caller = #recv_chunk_closing{client_called_us = true,
+                                                               pos_compl_received = true} = R} = State)
+  when {Cls,Trpt}=={tcp_closed,tcp} ; {Cls,Trpt}=={ssl_closed,ssl} ->
+    %% Maybe handle unprocessed chunk message before acking final chunk
+    self() ! {Cls, Socket}, 
+    {noreply, State#state{caller = R#recv_chunk_closing{dconn_closed = true}}};
 
 handle_info({Cls, Socket}, #state{dsock = {Trpt,Socket}, caller = recv_bin,
                                          data = Data} = State0)
-- 
2.26.2

openSUSE Build Service is sponsored by