From b7f54921f6618df7750c07ff8807b9f4b0baff06 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 11 Jul 2010 15:47:18 +0200 Subject: [PATCH] Now --timestamping and --continue works well together. --- NEWS | 2 ++ src/ChangeLog | 6 ++++++ src/http.c | 12 +++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index eec503f5..899807e4 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,8 @@ Please send GNU Wget bug reports to . and -c influences the transferred data amount. ** GNU TLS backend works again. + +** Now --timestamping and --continue works well together. * Changes in Wget 1.12 diff --git a/src/ChangeLog b/src/ChangeLog index 789d3bf7..78dfb977 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-07-11 Giuseppe Scrivano + + * http.c (http_loop): New variable `force_full_retrieve'. If the remote + file is newer that the local one then inhibit -c. + Reported by: Caleb Cushing . + 2010-07-09 Giuseppe Scrivano * css-url.c (get_urls_css_file): Use `wget_read_file' instead of diff --git a/src/http.c b/src/http.c index ace3bfe5..331c2e79 100644 --- a/src/http.c +++ b/src/http.c @@ -2609,6 +2609,7 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer, struct_stat st; bool send_head_first = true; char *file_name; + bool force_full_retrieve = false; /* Assert that no value for *LOCAL_FILE was passed. */ assert (local_file == NULL || *local_file == NULL); @@ -2732,7 +2733,9 @@ Spider mode enabled. Check if remote file exists.\n")); *dt &= ~HEAD_ONLY; /* Decide whether or not to restart. */ - if (opt.always_rest + if (force_full_retrieve) + hstat.restval = hstat.len; + else if (opt.always_rest && got_name && stat (hstat.local_file, &st) == 0 && S_ISREG (st.st_mode)) @@ -2920,8 +2923,11 @@ The sizes do not match (local %s) -- retrieving.\n"), } } else - logputs (LOG_VERBOSE, - _("Remote file is newer, retrieving.\n")); + { + force_full_retrieve = true; + logputs (LOG_VERBOSE, + _("Remote file is newer, retrieving.\n")); + } logputs (LOG_VERBOSE, "\n"); } -- 2.39.2