mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Put send_head_first check where it needs to be.
This commit is contained in:
parent
84eba7c587
commit
e402ae37f4
@ -1,3 +1,11 @@
|
||||
2007-10-08 Micah Cowan <micah@cowan.name>
|
||||
|
||||
* http.c (http_loop): Add send_head_first conditional back
|
||||
around code that needs it, but not around the last-modified
|
||||
header-parsing stuff this time. Removed no-longer-useful (was it
|
||||
ever?) restart_loop boolean, continuing unconditionally at end
|
||||
of send_head_first conditional block (if we haven't jumped out).
|
||||
|
||||
2007-10-04 Micah Cowan <micah@cowan.name>
|
||||
|
||||
* http.c (http_loop): We've got_name if content_disposition
|
||||
|
31
src/http.c
31
src/http.c
@ -2545,7 +2545,7 @@ Remote file does not exist -- broken link!!!\n"));
|
||||
/* Did we get the time-stamp? */
|
||||
if (!got_head)
|
||||
{
|
||||
bool restart_loop = false;
|
||||
got_head = true; /* no more time-stamping */
|
||||
|
||||
if (opt.timestamping && !hstat.remote_time)
|
||||
{
|
||||
@ -2563,20 +2563,24 @@ Last-modified header invalid -- time-stamp ignored.\n"));
|
||||
time_came_from_head = true;
|
||||
}
|
||||
|
||||
if (send_head_first)
|
||||
{
|
||||
/* The time-stamping section. */
|
||||
if (opt.timestamping)
|
||||
{
|
||||
if (hstat.orig_file_name) /* Perform the following checks only
|
||||
if the file we're supposed to
|
||||
if (hstat.orig_file_name) /* Perform the following
|
||||
checks only if the file
|
||||
we're supposed to
|
||||
download already exists. */
|
||||
{
|
||||
if (hstat.remote_time &&
|
||||
tmr != (time_t) (-1))
|
||||
{
|
||||
/* Now time-stamping can be used validly. Time-stamping
|
||||
means that if the sizes of the local and remote file
|
||||
match, and local file is newer than the remote file,
|
||||
it will not be retrieved. Otherwise, the normal
|
||||
/* Now time-stamping can be used validly.
|
||||
Time-stamping means that if the sizes of
|
||||
the local and remote file match, and local
|
||||
file is newer than the remote file, it will
|
||||
not be retrieved. Otherwise, the normal
|
||||
download procedure is resumed. */
|
||||
if (hstat.orig_file_tstamp >= tmr)
|
||||
{
|
||||
@ -2606,7 +2610,6 @@ The sizes do not match (local %s) -- retrieving.\n"),
|
||||
|
||||
/* free_hstat (&hstat); */
|
||||
hstat.timestamp_checked = true;
|
||||
restart_loop = true;
|
||||
}
|
||||
|
||||
if (opt.spider)
|
||||
@ -2617,7 +2620,6 @@ The sizes do not match (local %s) -- retrieving.\n"),
|
||||
{
|
||||
logputs (LOG_VERBOSE, _("\
|
||||
Remote file exists and could contain links to other resources -- retrieving.\n\n"));
|
||||
restart_loop = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2636,19 +2638,12 @@ Remote file exists but recursion is disabled -- not retrieving.\n\n"));
|
||||
}
|
||||
}
|
||||
|
||||
if (send_head_first)
|
||||
{
|
||||
got_name = true;
|
||||
restart_loop = true;
|
||||
}
|
||||
|
||||
got_head = true; /* no more time-stamping */
|
||||
*dt &= ~HEAD_ONLY;
|
||||
count = 0; /* the retrieve count for HEAD is reset */
|
||||
|
||||
if (restart_loop)
|
||||
continue;
|
||||
}
|
||||
} /* send_head_first */
|
||||
} /* !got_head */
|
||||
|
||||
if ((tmr != (time_t) (-1))
|
||||
&& ((hstat.len == hstat.contlen) ||
|
||||
|
Loading…
Reference in New Issue
Block a user