]> sjero.net Git - wget/commitdiff
Now --timestamping and --continue works well together.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 11 Jul 2010 13:47:18 +0000 (15:47 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 11 Jul 2010 13:47:18 +0000 (15:47 +0200)
NEWS
src/ChangeLog
src/http.c

diff --git a/NEWS b/NEWS
index eec503f507a0f0592742cf28cf4d460a4e4ffe82..899807e470b804a9caf0bfb7abe53dbd96eddea8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,8 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
    and -c influences the transferred data amount.
 
 ** GNU TLS backend works again.
+
+** Now --timestamping and --continue works well together.
 \f
 * Changes in Wget 1.12
 
index 789d3bf7e2c52e0597410f91dc98e2c7d00988be..78dfb97739520ef7bf2b944403e9ded8373b11ba 100644 (file)
@@ -1,3 +1,9 @@
+2010-07-11  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * 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 <xenoterracide@gmail.com>.
+
 2010-07-09  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * css-url.c (get_urls_css_file): Use `wget_read_file' instead of
index ace3bfe56d1ba4adb8aea31c5884a2a45b6e233c..331c2e7923ecf4ef14c495c20a7c0b42ce640d7c 100644 (file)
@@ -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");
                         }