]> sjero.net Git - wget/commitdiff
On a network error, attempt to resume the download, not restart it.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 21 Nov 2010 21:56:20 +0000 (22:56 +0100)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 21 Nov 2010 21:56:20 +0000 (22:56 +0100)
src/ChangeLog
src/ftp.c
src/http.c

index 51abb4ce3cd5255a1bc341660718fec60e2ce56f..7e5602242e85795883a617aa9f50c5a7a03b2770 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-21  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * ftp.c (getftp): If `count' is bigger than zero, try to resume the
+       download, not restart it.
+       * http.c (gethttp): Likewise.
+       Suggested by: Evgeny Kapun <abacabadabacaba@gmail.com>.
+
 2010-11-19  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * fttp.c (getftp): Accept new argument `count'.  When `count' is
index 8dddeed89cba85e1d83db44562c3a9c208edf059..c331d066f2c6569ca2434794367244f3d5a94f17 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1152,7 +1152,7 @@ Error in server response, closing control connection.\n"));
 # define BIN_TYPE_FILE 1
 #endif /* def __VMS [else] */
 
-      if (restval && !(con->cmd & DO_LIST))
+      if ((restval && !(con->cmd & DO_LIST)) || count > 0)
         {
 #ifdef __VMS
           int open_id;
@@ -1172,7 +1172,7 @@ Error in server response, closing control connection.\n"));
 #endif /* def __VMS [else] */
         }
       else if (opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct
-               || opt.output_document || count > 0)
+               || opt.output_document)
         {        
          if (opt.unlink && file_exists_p (con->target))
            {
index a0e41cac01791916e0561d2809c0928b22e1b47a..99f58b3f1a9d3ea69e312c495437eb34cbe2e3dd 100644 (file)
@@ -2468,7 +2468,7 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file));
       mkalldirs (hs->local_file);
       if (opt.backups)
         rotate_backups (hs->local_file);
-      if (hs->restval)
+      if (hs->restval || count > 0)
         {
 #ifdef __VMS
           int open_id;
@@ -2479,7 +2479,7 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file));
           fp = fopen (hs->local_file, "ab");
 #endif /* def __VMS [else] */
         }
-      else if (ALLOW_CLOBBER || count > 0)
+      else if (ALLOW_CLOBBER)
         {
          if (opt.unlink && file_exists_p (hs->local_file))
            {