mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Give a nicer message on a malformed status line.
This commit is contained in:
parent
bb3f805b86
commit
282798f52e
@ -1,3 +1,7 @@
|
|||||||
|
2010-05-05 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
|
* http.c (gethttp): Give a nicer message on a malformed status line.
|
||||||
|
|
||||||
2010-05-04 Giuseppe Scrivano <gscrivano@gnu.org>
|
2010-05-04 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
* http.c (gethttp): Check `resp_status' return code and handle
|
* http.c (gethttp): Check `resp_status' return code and handle
|
||||||
|
13
src/http.c
13
src/http.c
@ -1890,8 +1890,11 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
|||||||
statcode = resp_status (resp, &message);
|
statcode = resp_status (resp, &message);
|
||||||
if (statcode < 0)
|
if (statcode < 0)
|
||||||
{
|
{
|
||||||
logprintf (LOG_NOTQUIET, _("Invalid server response.\n"));
|
char *tms = datetime_str (time (NULL));
|
||||||
CLOSE_INVALIDATE (sock);
|
logprintf (LOG_VERBOSE, "%d\n", statcode);
|
||||||
|
logprintf (LOG_NOTQUIET, _("%s ERROR %d: %s.\n"), tms, statcode,
|
||||||
|
quotearg_style (escape_quoting_style,
|
||||||
|
_("Malformed status line")));
|
||||||
xfree (head);
|
xfree (head);
|
||||||
return HERR;
|
return HERR;
|
||||||
}
|
}
|
||||||
@ -1985,7 +1988,11 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
|||||||
statcode = resp_status (resp, &message);
|
statcode = resp_status (resp, &message);
|
||||||
if (statcode < 0)
|
if (statcode < 0)
|
||||||
{
|
{
|
||||||
logprintf (LOG_NOTQUIET, _("Invalid server response.\n"));
|
char *tms = datetime_str (time (NULL));
|
||||||
|
logprintf (LOG_VERBOSE, "%d\n", statcode);
|
||||||
|
logprintf (LOG_NOTQUIET, _("%s ERROR %d: %s.\n"), tms, statcode,
|
||||||
|
quotearg_style (escape_quoting_style,
|
||||||
|
_("Malformed status line")));
|
||||||
CLOSE_INVALIDATE (sock);
|
CLOSE_INVALIDATE (sock);
|
||||||
request_free (req);
|
request_free (req);
|
||||||
return HERR;
|
return HERR;
|
||||||
|
Loading…
Reference in New Issue
Block a user