]> sjero.net Git - wget/commitdiff
Don't download content just to ignore it.
authorMicah Cowan <micah@cowan.name>
Thu, 13 Nov 2008 08:59:53 +0000 (00:59 -0800)
committerMicah Cowan <micah@cowan.name>
Thu, 13 Nov 2008 08:59:53 +0000 (00:59 -0800)
src/ChangeLog
src/http.c

index 736a90e0ed4536ab44c01ea3902c89b184728c27..99cd940cd518cd927d1c91a2588c098c48cbf8dc 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-12  Micah Cowan  <micah@cowan.name>
 
        * ftp-ls.c (ftp_index): HTML-escape dir name in title, h1, a:href.
index 0866f92287bc9a106d2c117e9f9ff05c9ead5a63..cd0dba85ea73be5cc8cf230606e1cf485647b3a5 100644 (file)
@@ -2148,11 +2148,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. */