Fix another case of -N and -c not working well together.

This commit is contained in:
Giuseppe Scrivano 2010-07-18 20:10:42 +02:00
parent 29305e059f
commit 57584fe2da
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2010-07-18 Giuseppe Scrivano <gscrivano@gnu.org>
* http.c (gethttp): If -N is used, don't exit immediately if the content
length is less or equal than the existing file size. Specify "Range"
only if -N is not used.
Reported by: Caleb Cushing <xenoterracide@gmail.com>.
2010-07-14 Giuseppe Scrivano <gscrivano@gnu.org>
* ftp.c (max): Remove definition.

View File

@ -1645,7 +1645,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
request_set_header (req, "Referer", (char *) hs->referer, rel_none);
if (*dt & SEND_NOCACHE)
request_set_header (req, "Pragma", "no-cache", rel_none);
if (hs->restval)
if (hs->restval && !opt.timestamping)
request_set_header (req, "Range",
aprintf ("bytes=%s-",
number_to_static_string (hs->restval)),
@ -2376,9 +2376,8 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file));
}
if (statcode == HTTP_STATUS_RANGE_NOT_SATISFIABLE
|| (hs->restval > 0 && statcode == HTTP_STATUS_OK
&& contrange == 0 && hs->restval >= contlen)
)
|| (!opt.timestamping && hs->restval > 0 && statcode == HTTP_STATUS_OK
&& contrange == 0 && hs->restval >= contlen))
{
/* If `-c' is in use and the file has been fully downloaded (or
the remote file has shrunk), Wget effectively requests bytes