libunftp icon indicating copy to clipboard operation
libunftp copied to clipboard

Issue with data port timeout

Open robklg opened this issue 1 year ago • 1 comments

If unFTP times out on the connection of the Passive port, then give a successive data command, it locks up the control channel.

    May 27 19:58:02.337 DEBG Control channel event Command(Pasv), seq: 12
    May 27 19:58:02.337 DEBG Control channel reply CodeAndMsg { code: EnteringPassiveMode, msg: "Entering Passive Mode (127,0,0,1,244,8)" }, seq: 12
   May 27 19:58:17.340 WARN Client did not connect to data port in time
    May 27 19:58:39.498 DEBG Control channel event Command(Nlst { path: None }), seq: 13
    May 27 19:58:39.498 DEBG Control channel reply CodeAndMsg { code: FileStatusOkay, msg: "Sending directory list" }, seq: 13
    May 27 20:00:18.388 INFO Command stream ended.
    May 27 20:00:18.388 DEBG Control channel event InternalMsg(ExitControlLoop), seq: 14
    May 27 20:00:18.388 DEBG Control channel reply None, seq: 14
    May 27 20:00:18.389 INFO Exiting control loop

We are not giving back anything over the control channel to indicate that the data port is no longer available. The data command should return a 4xx.

To reproduce:

lftp localhost:/> quote pasv
---> TYPE I
<--- 200 Always in binary mode
---> pasv
227 Entering Passive Mode (127,0,0,1,224,130)
#### Wait for "WARN Client did not connect to data port in time"
lftp localhost:/> quote list
---> list
150 Sending directory list #### unFTP is stuck for this control channel, client needs to end the control session

robklg avatar May 27 '23 20:05 robklg