lftp  

Re: bug report

Alexander V. Lukyanov
Wed, 20 Apr 2005 01:43:54 -0700

On Wed, Apr 20, 2005 at 12:50:53PM +0800, [EMAIL PROTECTED] wrote:
> <--- 227 Entering Passive Mode (219,144,162,166,117,208)
> getpeername(control_sock): Transport endpoint is not connected

Do you use cygwin? If so, send bug report to cygwin maintainers.

As workaround, try this patch:

Index: ftpclass.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ftpclass.cc,v
retrieving revision 1.350
diff -u -p -r1.350 ftpclass.cc
--- ftpclass.cc 5 Mar 2005 07:07:02 -0000       1.350
+++ ftpclass.cc 20 Apr 2005 08:09:47 -0000
@@ -165,13 +165,13 @@ bool Ftp::Connection::data_address_ok(so
    else if(getpeername(data_sock,&d.sa,&len)==-1)
    {
       Log::global->Format(0,"getpeername(data_sock): %s\n",strerror(errno));
-      return false;
+      return !verify_address && !verify_port;
    }
    len=sizeof(c);
    if(getpeername(control_sock,&c.sa,&len)==-1)
    {
       Log::global->Format(0,"getpeername(control_sock): %s\n",strerror(errno));
-      return false;
+      return !verify_address;
    }

 #if INET6
@@ -3479,6 +3479,15 @@ void Ftp::SendOPTS_MLST()

 void Ftp::TuneConnectionAfterFEAT()
 {
+   if(conn->clnt_supported)
+   {
+      const char *client=Query("client",hostname);
+      if(client && client[0])
+      {
+        conn->SendCmd2("CLNT",client);
+        expect->Push(Expect::IGNORE);
+      }
+   }
    if(conn->lang_supported)
    {
       const char *lang_to_use=Query("lang",hostname);
@@ -3494,15 +3503,6 @@ void Ftp::TuneConnectionAfterFEAT()
       conn->SendCmd("OPTS UTF8 ON");
       expect->Push(Expect::OPTS_UTF8);
    }
-   if(conn->clnt_supported)
-   {
-      const char *client=Query("client",hostname);
-      if(client && client[0])
-      {
-        conn->SendCmd2("CLNT",client);
-        expect->Push(Expect::IGNORE);
-      }
-   }
    if(conn->host_supported)
    {
       conn->SendCmd2("HOST",hostname);

--
   Alexander.
  • Re: bug report Alexander V. Lukyanov