]> sjero.net Git - wget/commitdiff
Give a nicer message on a malformed status line.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 5 May 2010 10:27:29 +0000 (12:27 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 5 May 2010 10:27:29 +0000 (12:27 +0200)
src/ChangeLog
src/http.c

index 34e3ad1f20cf89a1170f3c74f1b79ee3d03aa937..4ba7cf46650e604131111d86f04f195c340921a3 100644 (file)
@@ -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>
 
        * http.c (gethttp): Check `resp_status' return code and handle
index 52ed83653c55b84d0b50c38570c955e31784c863..0ffbd66c8f8ac2ccf0641f908a16e2ddf4e5352b 100644 (file)
@@ -1890,8 +1890,11 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
           statcode = resp_status (resp, &message);
           if (statcode < 0)
             {
-              logprintf (LOG_NOTQUIET, _("Invalid server response.\n"));
-              CLOSE_INVALIDATE (sock);
+              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")));
               xfree (head);
               return HERR;
             }
@@ -1985,7 +1988,11 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
   statcode = resp_status (resp, &message);
   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);
       request_free (req);
       return HERR;