Hi,

I noticed this problem when trying to do a fresh install -- if selecting
packages takes too long, ftp mirrors will timeout, and setup will not
reconnect, causing the failure.  This patch fixes that.

As usual, the ChangeLog is below.
        Igor
==============================================================================
2005-09-27  Igor Pechtchanski  <[EMAIL PROTECTED]>

        * nio-ftp.cc (NetIO_FTP::NetIO_FTP): Reconnect on FTP timeout.

-- 
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_                [EMAIL PROTECTED]
ZZZzz /,`.-'`'    -.  ;-;;,_            [EMAIL PROTECTED]
     |,4-  ) )-,_. ,\ (  `'-'           Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL     a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA
Index: nio-ftp.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/nio-ftp.cc,v
retrieving revision 2.15
diff -u -p -r2.15 nio-ftp.cc
--- nio-ftp.cc  27 Dec 2004 16:12:44 -0000      2.15
+++ nio-ftp.cc  27 Sep 2005 15:58:16 -0000
@@ -63,6 +63,7 @@ NetIO_FTP::NetIO_FTP (char const *Purl):
   if (port == 0)
     port = 21;
 
+control_reconnect:
   if (cmd_host && strcmp (host, cmd_host) != 0 || port != cmd_port)
     {
       if (cmd)
@@ -122,6 +123,13 @@ NetIO_FTP::NetIO_FTP (char const *Purl):
       code = ftp_line (cmd);
     }
   while (code == 226);         /* previous RETR */
+  if (code == 421)              /* Timeout, retry */
+    {
+      log (LOG_BABBLE) << "FTP timeout -- reconnecting" << endLog;
+      delete [] cmd_host;
+      cmd_host = new char[1]; cmd_host[0] = '\0';
+      goto control_reconnect;
+    }
   if (code != 227)
     return;
 

Reply via email to