]> sjero.net Git - wget/commitdiff
Fix another case of -N and -c not working well together.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 18 Jul 2010 18:10:42 +0000 (20:10 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 18 Jul 2010 18:10:42 +0000 (20:10 +0200)
src/ChangeLog
src/http.c

index 5592e604d82c3e28ccd18b6c43940251946c2cc9..fbfc34bd35fa54bd36f3f8d6741a9df13b6a59b2 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-18  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * http.c (gethttp): If -N is used, don't exit immediately if the content
+       length is less or equal than the existing file size.  Specify "Range"
+       only if -N is not used.
+       Reported by: Caleb Cushing <xenoterracide@gmail.com>.
+
 2010-07-14  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * ftp.c (max): Remove definition.
index 331c2e7923ecf4ef14c495c20a7c0b42ce640d7c..28fd24f91807798b14c008b44c3c6851811625fe 100644 (file)
@@ -1645,7 +1645,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
   request_set_header (req, "Referer", (char *) hs->referer, rel_none);
   if (*dt & SEND_NOCACHE)
     request_set_header (req, "Pragma", "no-cache", rel_none);
-  if (hs->restval)
+  if (hs->restval && !opt.timestamping)
     request_set_header (req, "Range",
                         aprintf ("bytes=%s-",
                                  number_to_static_string (hs->restval)),
@@ -2376,9 +2376,8 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file));
     }
 
   if (statcode == HTTP_STATUS_RANGE_NOT_SATISFIABLE
-      || (hs->restval > 0 && statcode == HTTP_STATUS_OK
-          && contrange == 0 && hs->restval >= contlen)
-     )
+      || (!opt.timestamping && hs->restval > 0 && statcode == HTTP_STATUS_OK
+          && contrange == 0 && hs->restval >= contlen))
     {
       /* If `-c' is in use and the file has been fully downloaded (or
          the remote file has shrunk), Wget effectively requests bytes