summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Nilsson <hans@erlang.org>2019-09-10 15:43:40 +0200
committerHans Nilsson <hans@erlang.org>2019-09-10 15:43:40 +0200
commitb76f435aa67a226e6f87802dcde319c049629797 (patch)
tree1350660e6185d1844e588a21977c0c72e915372a
parent3fb6775949a0d0525698d9aee0bc63eac2471203 (diff)
downloaderlang-b76f435aa67a226e6f87802dcde319c049629797.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.
-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