]> sjero.net Git - wget/commitdiff
[svn] Before concluding that the file is already fully retrieved, make sure
authorhniksic <devnull@localhost>
Fri, 11 May 2001 12:37:37 +0000 (05:37 -0700)
committerhniksic <devnull@localhost>
Fri, 11 May 2001 12:37:37 +0000 (05:37 -0700)
that the file existed and `Range' was actually requested.

Published in <sxseltwf4ks.fsf@florida.arsdigita.de>.

src/ChangeLog
src/http.c

index 918b05909f320ad0c7cf91140b76abfafcad07fe..6666f589d65369eaa823cd794cc7a2a95e2601cd 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-09  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * http.c (gethttp): Before concluding that the file is already
+       fully retrieved, make sure that the file existed and `Range' was
+       actually requested.
+
 2001-05-09  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * cookies.c (eliminate_dups): New function.
index bf6a57ea9848301cf9592d5b9562f964d08aec30..23ed7ddc708580eec36cec3ed5fde5f404b3eb08 100644 (file)
@@ -1190,7 +1190,11 @@ Accept: %s\r\n\
       if (opt.always_rest)
        {
          /* Check for condition #2. */
-         if (hs->restval >= contlen)
+         if (hs->restval > 0               /* restart was requested. */
+             && contlen != -1              /* we got content-length. */
+             && hs->restval >= contlen     /* file fully downloaded
+                                              or has shrunk.  */
+             )
            {
              logputs (LOG_VERBOSE, _("\
 \n    The file is already fully retrieved; nothing to do.\n\n"));