TIdFTP fails on Active mode transfer connection with vsFTPd #300
Labels
Element: FTP
Issues related to FTP handling, TIdFTP and TIdFTPServer, etc
Element: TCP
Issues related to TCP handling, TIdTCPClient and TIdTCPServer descendants, etc
Status: Fixed
Issue has been fixed, no further work needed
Type: Bug
Issue is a bug in existing code
A user reported on StackOverflow that
TIdFTP
is not accepting an Active mode file transfer from vsFTPd.According to the below Wireshark capture, vsFTPd is creating the transfer connection BEFORE sending a response to the
RETR
command:The user also tested with ICS and was able to perform the same transfer OK:
ICS's
TFtpClient
allows that connection before receiving theRETR
response. But Indy'sTIdFTP
waits for theRETR
response to arrive before it will then accept the transfer connection (this also applies toSTOR
/STOU
/APPE
requests, too), due to its use ofTIdTCPConnection.SendCmd()
.Re-reading RFC 959, it says the following:
ICS is asynchronous, so this situation is not a big deal for it to handle. But Indy uses blocking sockets, so
TIdFTP
will have to be updated to account for this situation, likely by monitoring both command and transfer ports simultaneously so it can act accordingly regardless of the order in which the transfer connection and the command response arrive in.The text was updated successfully, but these errors were encountered: