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:
parent
3b00da8f9a
commit
05a000a477
@ -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
|
||||
|
17
src/http.c
17
src/http.c
@ -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
|
||||
&& stat (locf, &st) == 0
|
||||
&& S_ISREG (st.st_mode))
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user