:-( Apologies for the top-posting. Please don't quote this message )-:

Yes, this patch produced correct behaviour (as far as I can tell :-)
Downloading a file (with -c) for the first time, regardless of whether the
server supported resume, succeeded.

Downloading a file (with -c) for the second time:
* If the server supports resume, then "File is fully downloaded, nothing to
do"
* If the server doesn't support resume, then "Refusing to truncate file"

Downloading a file (with -c) again, after manually truncating it:
* If the server supports resume, then it skips past the downloaded part
correctly, and gets the rest.
* If the server doesn't support resume, then "Refusing to truncate file"

It is up to somebody else to dream up more scenarios.
--
Csaba R�duly, Software Engineer                     Sophos Anti-Virus
email: [EMAIL PROTECTED]                  http://www.sophos.com
US support: +1 888 SOPHOS 9               UK Support: +44 1235 559933




                                                                                       
                     
                    Hrvoje Niksic                                                      
                     
                    <hniksic@arsdigita        To:     Wget List <[EMAIL PROTECTED]>      
                     
                    .com>                     cc:                                      
                     
                    Sent by:                  Subject:     Re: windows, continue bug   
                     
                    [EMAIL PROTECTED]                                                 
                     
                    sdigita.de                                                         
                     
                                                                                       
                     
                                                                                       
                     
                    09/05/01 19:26                                                     
                     
                                                                                       
                     
                                                                                       
                     




[EMAIL PROTECTED] writes:

> At least the CVS version I downloaded on 9th of May still has the
problem:
>
> wget -c http://some.random.com/              results in
> "The file is already fully retrieved, nothing to do." and nothing is
> downloaded :-(

Ah, I see.  This is a different bug from the one Herold was seeing.
Thanks for the explanation.

Does this patch fix the problem?

 2001-05-09  Hrvoje Niksic  <[EMAIL PROTECTED]>

     * http.c (gethttp): Before concluding that the file is already
     fully retrieved, make sure that the file existed and `Range' was
     actually requested.

Index: src/http.c
===================================================================
RCS file: /pack/anoncvs/wget/src/http.c,v
retrieving revision 1.58
diff -u -r1.58 http.c
--- src/http.c 2001/05/08 11:47:05 1.58
+++ src/http.c 2001/05/09 18:25:41
@@ -1190,7 +1190,11 @@
       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"));



Reply via email to