1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Don't clobber the file when -c fails in the first attempt.

This commit is contained in:
hniksic 2005-05-17 02:01:31 -07:00
parent 3b00da8f9a
commit 05a000a477
2 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2005-05-17 Hrvoje Niksic <hniksic@xemacs.org>
* http.c (http_loop): Don't clobber the file when -c is specified
and the first attempt to retrieve the file fails.
2005-05-16 Hrvoje Niksic <hniksic@xemacs.org>
* openssl.c (ssl_check_certificate): Print all issues with a

View File

@ -2141,13 +2141,18 @@ File `%s' already there, will not retrieve.\n"), *hstat.local_file);
*dt &= ~HEAD_ONLY;
/* Decide whether or not to restart. */
hstat.restval = 0;
if (count > 1)
hstat.restval = hstat.len; /* continue where we left off */
else if (opt.always_rest
if (opt.always_rest
&& stat (locf, &st) == 0
&& S_ISREG (st.st_mode))
/* When -c is used, continue from on-disk size. (Can't use
hstat.len even if count>1 because we don't want a failed
first attempt to clobber existing data.) */
hstat.restval = st.st_size;
else if (count > 1)
/* otherwise, continue where the previous try left off */
hstat.restval = hstat.len;
else
hstat.restval = 0;
/* Decide whether to send the no-cache directive. We send it in
two cases: