delphiindyindy10

Regression in FTP Client implementation using indy since upgrading to Delphi 11


I'm having issues with an FTP driver we have that's using indy's idFTP. The regression appeared in our software when we upgraded from delphi 10.2 to delphi 11.

The connection and authentication seems to be going ok and then the listing phase fails. Here are wireshark captures of that sequence with both the D10.2 and D11 versions of our application. The server used is Filezilla for easier reproduction but we have observed similar behavior with the FTP Server we're usually targetting.

With Delphi 10.2, functionnal : D10.2 - ok

With Delphi 11, non functionnal : D11 - nok

The main difference i'm observing is that the MLSD command emitted by the client does not include line endings anymore (/r/n) like all commands do. I'm guessing this is where the issue comes from.

I tried looking at a diff of idFTP.pas between both verions of delphi but there are too many changes and i'm not able to locate the root cause of the issue.

I've seen issues online that seems similar to mine (related to line endings with fixes being replacing Write() with WriteLn() in some occasions, so maybe this is part of a broader set of changes).

hoping someone has an idea.


Solution

  • This is a known issue in Indy:

    #377: FTP LIST timeout with latest Delphi 11 (and idFTP)

    This has already been fixed in Indy, but the fix was not included in the version that shipped with Delphi 11.

    Note that the issue only affects Active mode transfers (TIdFTP.Passive=false), so use Passive mode instead (TIdFTP.Passive=true) (which you should anyway). And consider updating your Indy version to the latest.