From 475c452780ea76fcc5678e5e48308192c78611f2 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 25 May 2010 17:52:13 +0200 Subject: [PATCH] Ignore HTTP 1xx responses. --- src/ChangeLog | 5 +++++ src/http.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index edbd3493..a476e7cd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-05-25 Giuseppe Scrivano + + * http.c (H_10X): New macro. + (gethttp): Silently ignore 1xx responses. + 2010-05-24 Giuseppe Scrivano * iri.h (dummy_iri): Define static. diff --git a/src/http.c b/src/http.c index c5aa8ea0..60f4f846 100644 --- a/src/http.c +++ b/src/http.c @@ -93,6 +93,7 @@ static struct cookie_jar *wget_cookie_jar; #define TEXTCSS_S "text/css" /* Some status code validation macros: */ +#define H_10X(x) (((x) >= 100) && ((x) < 200)) #define H_20X(x) (((x) >= 200) && ((x) < 300)) #define H_PARTIAL(x) ((x) == HTTP_STATUS_PARTIAL_CONTENTS) #define H_REDIRECTED(x) ((x) == HTTP_STATUS_MOVED_PERMANENTLY \ @@ -1958,6 +1959,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy, contrange = 0; *dt &= ~RETROKF; +read_header: head = read_http_response_head (sock); if (!head) { @@ -1995,6 +1997,13 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy, request_free (req); return HERR; } + + if (H_10X (statcode)) + { + DEBUGP (("Ignoring response\n")); + goto read_header; + } + hs->message = xstrdup (message); if (!opt.server_response) logprintf (LOG_VERBOSE, "%2d %s\n", statcode, -- 2.39.2