Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Feb : Indy FTP Response Codes for NLST

www.cryer.info
Managed Newsgroup Archive

Indy FTP Response Codes for NLST

Subject:Indy FTP Response Codes for NLST
Posted by:"Erik Berry" (..@techie.zzzcom)
Date:Wed, 14 Feb 2007 03:50:53

I'm connecting today's Indy 10 development source to a Linux FTP server.
When I'm in an empty directory on the server, I call TIdFTP.List(StrLst, '',
False) it gets into TIdFTP.InternalGet with the NLST command and calls this:

SendCmd(ACommand, [125, 150, 154]); //APR: Ericsson Switch FTP);

My FTP server returns a response 226 with a text of "Transfer Complete."
Because the code 226 is not in the array of acceptable responses above, it
raises an exception from TIdReplyRFC.RaiseReplyError eventually.

The Linux server is "Linux <hostname>
2.4.29-grsec+w+fhs6b+gr0501+nfs+a32+++p4+sata+c4+gr2b-v6.189 #1 SMP Mon Feb
7 13:23:30 PST 2005 i686 GNU/Linux"

ftp> QUOTE SYST
215 UNIX Type: L8

If the same NLST command is called in a non-empty directory, things seem to
work fine.  It seems the latest official release (Indy 10.0.52) acts the same.

It looks like Indy is interpreting the Transfer Complete. result as part of
the directory listing, such that even if I allow the 226 code to pass
through, it hangs on the next LPortSv.Listen call waiting for the 226 it
already consumed.

I haven't had time to look deeper than this, but I thought I'd go ahead and
report this in case I don't get back to it.

The amusing side note is that a user viewing this exception sees an error
that states "Transfer complete.", even the operation fails. :)

Erik

Replies:

www.cryer.info
Managed Newsgroup Archive