]> sjero.net Git - wget/commitdiff
[svn] Fix #20322 - Use timestamp from most recent response.
authormicah <devnull@localhost>
Thu, 30 Aug 2007 03:35:49 +0000 (20:35 -0700)
committermicah <devnull@localhost>
Thu, 30 Aug 2007 03:35:49 +0000 (20:35 -0700)
ChangeLog
NEWS
src/ChangeLog
src/http.c

index e8ba39630a43ec827b52449787e88b3114a7389e..2312d00f935af370e19f279a50f6d0b6d0d8f2c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * m4/wget.m4 (WGET_PROCESS_PO, AM_PATH_PROG_WITH_TEST): Add
        missing M4 quotation.  Delete serial number.
 
+2007-08-09  Micah Cowan  <micah@cowan.name>
+
+       * NEWS: Timestamping from most recent response.
+
 2007-08-08  Micah Cowan  <micah@cowan.name>
 
        * NEWS: Call attention to the fact that Content-Disposition is
diff --git a/NEWS b/NEWS
index 41cc5c0e54a2e4927e522c1be1c2f4f9e5b7bd5b..64cb7965decedf5027a2de6e0e5ed511211ef4a2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
 \f
 * Changes in Wget 1.11.
 
+** Timestamping now uses the value from the most recent HTTP response,
+rather than the first one it got.
+
 ** configure.in now requires autoconf >= 2.61, rather than 2.59.
 
 ** Authentication information is no longer sent as part of the Referer
index d727a40e27621ef77e75fd95e782a6e0ce632b86..be8233efefe5d5ccf2872a12a23df864f4000736 100644 (file)
        * spider.c (print_broken_links): Fixed incorrect plurals msgid
        usage, switched to use ngettext function.
 
+2007-08-24  Micah Cowan  <micah@cowan.name>
+
+       * http.c (http_loop): Introduced time_came_from_head boolean
+       flag, to help avoid parsing the same Last-Modified header twice,
+
 2007-08-23  Joshua David Williams  <yurimxpxman@gmail.com>
 
        * spider.c (in_url_list_p): Removed the bool verbose argument
        * url.c (url_string): Use comparison, not assignment, in
        check for auth_mode == URL_AUTH_HIDE_PASSWD.
 
+2007-08-09  Micah Cowan  <micah@cowan.name>
+
+       * http.c (http_loop): If we got a HEAD and then a GET, and the
+       GET had a timestamp, use that one, not any we may have gotten
+       from the HEAD.
+
 2007-08-08  Micah Cowan  <micah@cowan.name>
 
        * init.c (defaults): Content disposition will not be default,
index 26342593ac582c381c37a3988da34046e8204ca9..414e8e696d39aeb8e52ebf7c32ca2a170ef2c235 100644 (file)
@@ -2305,6 +2305,7 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
 {
   int count;
   bool got_head = false;         /* used for time-stamping and filename detection */
+  bool time_came_from_head = false;
   bool got_name = false;
   char *tms;
   const char *tmrate;
@@ -2533,6 +2534,8 @@ Last-modified header missing -- time-stamps turned off.\n"));
               if (tmr == (time_t) (-1))
                 logputs (LOG_VERBOSE, _("\
 Last-modified header invalid -- time-stamp ignored.\n"));
+              if (*dt & HEAD_ONLY)
+                time_came_from_head = true;
             }
       
           /* The time-stamping section.  */
@@ -2637,7 +2640,18 @@ Remote file exists but recursion is disabled -- not retrieving.\n\n"));
           else
             fl = hstat.local_file;
           if (fl)
-            touch (fl, tmr);
+            {
+              time_t newtmr = -1;
+              /* Reparse time header, in case it's changed. */
+              if (time_came_from_head
+                  && hstat.remote_time && hstat.remote_time[0])
+                {
+                  newtmr = http_atotm (hstat.remote_time);
+                  if (newtmr != -1)
+                    tmr = newtmr;
+                }
+              touch (fl, tmr);
+            }
         }
       /* End of time-stamping section. */