diff lib/protocols.c @ 303:3b9d5797050f

2003-11-2 Brian Masney <masneyb@gftp.org> * lib/rfc2068.c (rfc2068_chunked_read) - more improvements to this function so that it will parse more chunked file transfers correctly. * lib/misc.c lib/gftp.h lib/rfc2068.c src/gtk/bookmarks.c src/gtk/dnd.c - removed remove_double_slashes(). Call gftp_build_path() to build the paths. This now allows Novell directory listings with //server * lib/protocols.c src/gtk/transfer.c lib/gftp.h - added variable conn_error_no_timeout to gftp_transfer structure. If this is enabled, if the remote connection to the server timed out, don't wait and immediately reconnect. So far, the only time this is used is when the user was editing a file and it is to be uploaded back to the server. * src/gtk/gftp-gtk.h src/gtk/transfer.c - add_file_transfer() now returns the struct gftp_transfer that was just added. * src/gtk/misc-gtk.c (update_directory_download_progress) - don't make the window a popup and remove the window decorations * src/text/gftp-text.c - don't populate the transfer_direction variable in struct gftp_transfer. This is only needed by the GTK+ port and will hopefully be taken out soon. * lib/gftp.h - remove gftp_transfer_type enum. It wasn't used anymore.
author masneyb
date Mon, 03 Nov 2003 02:14:05 +0000
parents 4747f621b79b
children cc2eeb30b793
line wrap: on
line diff
--- a/lib/protocols.c	Thu Oct 30 22:26:40 2003 +0000
+++ b/lib/protocols.c	Mon Nov 03 02:14:05 2003 +0000
@@ -2503,33 +2503,38 @@
     {
       if (num_read == GFTP_EFATAL)
         return (GFTP_EFATAL);
-      else if (retries != 0 && 
-               tdata->current_file_retries >= retries)
+      else if (!tdata->conn_error_no_timeout)
         {
-          tdata->fromreq->logging_function (gftp_logging_error, tdata->fromreq,
-                   _("Error: Remote site %s disconnected. Max retries reached...giving up\n"),
-                   tdata->fromreq->hostname != NULL ? 
-                         tdata->fromreq->hostname : tdata->toreq->hostname);
-          return (GFTP_EFATAL);
-        }
-      else
-        {
-          tdata->fromreq->logging_function (gftp_logging_error, tdata->fromreq,
-                     _("Error: Remote site %s disconnected. Will reconnect in %d seconds\n"),
-                     tdata->fromreq->hostname != NULL ? 
-                           tdata->fromreq->hostname : tdata->toreq->hostname, 
-                     sleep_time);
+          if (retries != 0 && 
+              tdata->current_file_retries >= retries)
+            {
+              tdata->fromreq->logging_function (gftp_logging_error, tdata->fromreq,
+                       _("Error: Remote site %s disconnected. Max retries reached...giving up\n"),
+                       tdata->fromreq->hostname != NULL ? 
+                             tdata->fromreq->hostname : tdata->toreq->hostname);
+              return (GFTP_EFATAL);
+            }
+          else
+            {
+              tdata->fromreq->logging_function (gftp_logging_error, tdata->fromreq,
+                         _("Error: Remote site %s disconnected. Will reconnect in %d seconds\n"),
+                         tdata->fromreq->hostname != NULL ? 
+                             tdata->fromreq->hostname : tdata->toreq->hostname, 
+                         sleep_time);
+            }
         }
 
       while (retries == 0 || 
              tdata->current_file_retries <= retries)
         {
-          if (!tdata->skip_file)
+          if (!tdata->conn_error_no_timeout && !tdata->skip_file)
             {
               tv.tv_sec = sleep_time;
               tv.tv_usec = 0;
               select (0, NULL, NULL, NULL, &tv);
             }
+          else
+            tdata->conn_error_no_timeout = 0;
 
           if ((ret1 = gftp_connect (tdata->fromreq)) == 0 &&
               (ret2 = gftp_connect (tdata->toreq)) == 0)