mirror of
https://github.com/mirror/wget.git
synced 2025-03-10 01:30:16 +08:00
Do not overwrite restval if len is smaller
* src/http.c (http_loop): overwrite 'restval' only if 'len' is greater than it. Else substract 'len' to 'restval'. When retrying a request, only send a 'Range' header if the previous request returned data.
This commit is contained in:
parent
33bc3aae51
commit
928c54d27e
@ -4335,8 +4335,13 @@ http_loop (const struct url *u, struct url *original_url, char **newloc,
|
|||||||
first attempt to clobber existing data.) */
|
first attempt to clobber existing data.) */
|
||||||
hstat.restval = st.st_size;
|
hstat.restval = st.st_size;
|
||||||
else if (count > 1)
|
else if (count > 1)
|
||||||
|
{
|
||||||
/* otherwise, continue where the previous try left off */
|
/* otherwise, continue where the previous try left off */
|
||||||
|
if (hstat.len < hstat.restval)
|
||||||
|
hstat.restval -= hstat.len;
|
||||||
|
else
|
||||||
hstat.restval = hstat.len;
|
hstat.restval = hstat.len;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
hstat.restval = 0;
|
hstat.restval = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user