[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#92757: apt-get fails to connect through a socks server



En réponse à Jason Gunthorpe <jgg@debian.org>:

thanks for the explanations. 

> Swapping the order of getsockname and the login at the end of the
> function
> should be sufficient to hide the problem, could you test this?

Yes, it works like a charm. Bravo ! Here's the patch that I did to try out:

michel@agenor:apt$ diff -u methods/ftp.cc-org methods/ftp.cc
--- methods/ftp.cc-org  Thu Mar  8 03:20:43 2001
+++ methods/ftp.cc      Wed Apr  4 10:37:40 2001
@@ -159,13 +159,16 @@
    if (getpeername(ServerFd,(sockaddr *)&PeerAddr,&PeerAddrLen) != 0)
       return _error->Errno("getpeername","Unable to determine the peer name");
    
+   bool TempRC;
+   Owner->Status("Logging in");
+   TempRC = Login();
+   
    // Get the local machine's address
    ServerAddrLen = sizeof(ServerAddr);
    if (getsockname(ServerFd,(sockaddr *)&ServerAddr,&ServerAddrLen) != 0)
       return _error->Errno("getsockname","Unable to determine the local name");
    
-   Owner->Status("Logging in");
-   return Login();
+   return TempRC;
 }
                                                                        /*}}}*/
 // FTPConn::Login - Login to the remote server                         /*{{{*/

> But really, the APT code is correct, it is dante that (continues) to
> be
> flawed in its support for non-blocking connects.
 
I'll take your word for it ;) I shall try if other implementations give
better results (socks, tsocks).

Thanks.

Michel Casabona



Reply to: