summaryrefslogtreecommitdiff
path: root/lib/ftp
diff options
context:
space:
mode:
authorHans Nilsson <hans@erlang.org>2019-09-10 15:43:40 +0200
committerHans Nilsson <hans@erlang.org>2019-10-23 14:45:05 +0200
commit9a1c36c10abfe8e4a6d59c0e8f6bccf5a54d0a02 (patch)
tree1489ad1e2ba7c5679de243c249ee532e53c33aad /lib/ftp
parent76b004486063ac78586c8de69b2a7c9bd5ecc1f5 (diff)
downloaderlang-9a1c36c10abfe8e4a6d59c0e8f6bccf5a54d0a02.tar.gz
ftp: Break loop
when a partial message is in CtrlData. Appending <<>> from activate_ctrl_connection (2nd clause) will cause the {continue,NewCtrlData} to be selected. But since NewCtrlData == CtrlData, an infinite loop did occur.
Diffstat (limited to 'lib/ftp')
-rw-r--r--lib/ftp/src/ftp.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ftp/src/ftp.erl b/lib/ftp/src/ftp.erl
index 18cd8c7524..e9be7b8ff7 100644
--- a/lib/ftp/src/ftp.erl
+++ b/lib/ftp/src/ftp.erl
@@ -1399,10 +1399,13 @@ handle_info({Transport, Socket, Data}, #state{csock = {Transport, Socket},
ctrl_data =
{NextMsgData, [], start}})
end;
- {continue, NewCtrlData} ->
+ {continue, NewCtrlData} when NewCtrlData =/= CtrlData ->
?DBG(' ...Continue... ctrl_data=~p~n',[NewCtrlData]),
State = activate_ctrl_connection(State0),
- {noreply, State#state{ctrl_data = NewCtrlData}}
+ {noreply, State#state{ctrl_data = NewCtrlData}};
+ {continue, NewCtrlData} when NewCtrlData == CtrlData ->
+ ?DBG(' ...Continue... ctrl_data=~p~n',[NewCtrlData]),
+ {noreply, State0}
end;
%% If the server closes the control channel it is