1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

stsc's better-messages-for-spider-mode patch.

This commit is contained in:
Micah Cowan 2008-06-22 15:07:19 -07:00
parent c98aeb0cc3
commit b2dbe2b7e4
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-06-22 Steven Schubiger <schubiger@gmail.com>
* http.c: Make -nv --spider include the file's name when it
exists.
2008-06-22 Micah Cowan <micah@cowan.name> 2008-06-22 Micah Cowan <micah@cowan.name>
* Makefile.am (version.c): Fixed version string invocation so it * Makefile.am (version.c): Fixed version string invocation so it

View File

@ -1296,6 +1296,7 @@ struct http_stat
char *remote_time; /* remote time-stamp string */ char *remote_time; /* remote time-stamp string */
char *error; /* textual HTTP error */ char *error; /* textual HTTP error */
int statcode; /* status code */ int statcode; /* status code */
char *message; /* status message */
wgint rd_size; /* amount of data read from socket */ wgint rd_size; /* amount of data read from socket */
double dltime; /* time it took to download the data */ double dltime; /* time it took to download the data */
const char *referer; /* value of the referer header. */ const char *referer; /* value of the referer header. */
@ -1713,6 +1714,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
resp = resp_new (head); resp = resp_new (head);
statcode = resp_status (resp, &message); statcode = resp_status (resp, &message);
hs->message = xstrdup (message);
resp_free (resp); resp_free (resp);
xfree (head); xfree (head);
if (statcode != 200) if (statcode != 200)
@ -1795,6 +1797,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
/* Check for status line. */ /* Check for status line. */
message = NULL; message = NULL;
statcode = resp_status (resp, &message); statcode = resp_status (resp, &message);
hs->message = xstrdup (message);
if (!opt.server_response) if (!opt.server_response)
logprintf (LOG_VERBOSE, "%2d %s\n", statcode, logprintf (LOG_VERBOSE, "%2d %s\n", statcode,
message ? quotearg_style (escape_quoting_style, message) : ""); message ? quotearg_style (escape_quoting_style, message) : "");
@ -2662,19 +2665,20 @@ The sizes do not match (local %s) -- retrieving.\n"),
if (opt.spider) if (opt.spider)
{ {
bool finished = true;
if (opt.recursive) if (opt.recursive)
{ {
if (*dt & TEXTHTML) if (*dt & TEXTHTML)
{ {
logputs (LOG_VERBOSE, _("\ logputs (LOG_VERBOSE, _("\
Remote file exists and could contain links to other resources -- retrieving.\n\n")); Remote file exists and could contain links to other resources -- retrieving.\n\n"));
finished = false;
} }
else else
{ {
logprintf (LOG_VERBOSE, _("\ logprintf (LOG_VERBOSE, _("\
Remote file exists but does not contain any link -- not retrieving.\n\n")); Remote file exists but does not contain any link -- not retrieving.\n\n"));
ret = RETROK; /* RETRUNNEEDED is not for caller. */ ret = RETROK; /* RETRUNNEEDED is not for caller. */
goto exit;
} }
} }
else else
@ -2691,6 +2695,14 @@ but recursion is disabled -- not retrieving.\n\n"));
Remote file exists.\n\n")); Remote file exists.\n\n"));
} }
ret = RETROK; /* RETRUNNEEDED is not for caller. */ ret = RETROK; /* RETRUNNEEDED is not for caller. */
}
if (finished)
{
logprintf (LOG_NONVERBOSE,
_("%s URL:%s %2d %s\n"),
tms, u->url, hstat.statcode,
hstat.message ? escnonprint (hstat.message) : "");
goto exit; goto exit;
} }
} }