From 57584fe2daa4606e39bb23a6846566d9afc6070a Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 18 Jul 2010 20:10:42 +0200 Subject: [PATCH] Fix another case of -N and -c not working well together. --- src/ChangeLog | 7 +++++++ src/http.c | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5592e604..fbfc34bd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2010-07-18 Giuseppe Scrivano + + * 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 . + 2010-07-14 Giuseppe Scrivano * ftp.c (max): Remove definition. diff --git a/src/http.c b/src/http.c index 331c2e79..28fd24f9 100644 --- a/src/http.c +++ b/src/http.c @@ -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 -- 2.39.2