]> sjero.net Git - wget/commitdiff
Not-so-automated merge.
authorMicah Cowan <micah@cowan.name>
Tue, 2 Dec 2008 06:59:03 +0000 (22:59 -0800)
committerMicah Cowan <micah@cowan.name>
Tue, 2 Dec 2008 06:59:03 +0000 (22:59 -0800)
src/ChangeLog
src/http.c

index 744ff2d26556e01e1c762728a812bc73b21f819a..5e7fc16d0fad4451d0d98f1c6d09785438d061bd 100644 (file)
@@ -1,3 +1,8 @@
+2008-11-13  Micah Cowan  <micah@cowan.name>
+
+       * http.c (gethttp): Don't do anything when content-length >= our
+       requested range.
+
 2008-11-27  Saint Xavier  <wget@sxav.eu>
 
        * http.c (gethttp): Move authentication code before filename
index a52df265271a0c819641846a30f415d397827f0d..090950d2870c3eb0864d81f3f673ac2909ca6c0b 100644 (file)
@@ -2152,11 +2152,15 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file));
         }
     }
 
-  if (statcode == HTTP_STATUS_RANGE_NOT_SATISFIABLE)
+  if (statcode == HTTP_STATUS_RANGE_NOT_SATISFIABLE
+      || (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
-         after the end of file and the server response with 416.  */
+         after the end of file and the server response with 416
+         (or 200 with a <= Content-Length.  */
       logputs (LOG_VERBOSE, _("\
 \n    The file is already fully retrieved; nothing to do.\n\n"));
       /* In case the caller inspects. */