]> sjero.net Git - wget/commitdiff
Ignore HTTP 1xx responses.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 25 May 2010 15:52:13 +0000 (17:52 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 25 May 2010 15:52:13 +0000 (17:52 +0200)
src/ChangeLog
src/http.c

index edbd3493d2ab4d57b2849410d2c7f5cac54c4f3b..a476e7cdb9f7cae98c8e699eb46509f9308e4312 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-25  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * http.c (H_10X): New macro.
+       (gethttp): Silently ignore 1xx responses.
+
 2010-05-24  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * iri.h (dummy_iri): Define static.
index c5aa8ea025ad18a7b16aa746da0bafdda1fc5fd5..60f4f846620dc631092dacbf902dde49f7eb007b 100644 (file)
@@ -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,