[svn] Fix #20322 - Use timestamp from most recent response.

This commit is contained in:
micah 2007-08-29 20:35:49 -07:00
parent a7d6a8b512
commit 4358313069
4 changed files with 33 additions and 1 deletions

View File

@ -17,6 +17,10 @@
* 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

3
NEWS
View File

@ -7,6 +7,9 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
* 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

View File

@ -24,6 +24,11 @@
* 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
@ -39,6 +44,12 @@
* 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,

View 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. */