Ticket #121: Fixed IPV4 FTP connection scheme
commita402ebc98104d3b056d127f3378b0d89c674068c
authorYury V. Zaytsev <yury@shurup.com>
Wed, 8 Sep 2010 19:03:41 +0000 (8 21:03 +0200)
committerYury V. Zaytsev <yury@shurup.com>
Wed, 15 Sep 2010 11:49:02 +0000 (15 13:49 +0200)
treefe09dcaa242ecf317971bb84d1e84867cb54b981
parent0406a18dd4a7eabe62c450ab4d1f9acf1d0107d2
Ticket #121: Fixed IPV4 FTP connection scheme

    * Fixed endianness issue introduced by IPV6 patch, which prevented
      active connections to be established via PORT mechanism.

      FTP server always expects to see the port broken down into bytes
      in network byte order, so the transformation to host byte order is
      only needed when using EPRT.

    * Some IPV4 FTP servers and FTP ALGs / NATs with connection tracking
      become confused when you try to use EPSV or EPRT instead of PASV or
      PORT respectively.

      This commit changes current FTP connection scheme: if we deal with
      an IPV4 host, instead of first trying to use EPRT, first try to
      use PORT and only if it fails try EPRT as a fallback.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
lib/vfs/mc-vfs/ftpfs.c