]> sjero.net Git - wget/commitdiff
[svn] Prettier printing of HTTP headers.
authorhniksic <devnull@localhost>
Sun, 18 Nov 2001 02:36:30 +0000 (18:36 -0800)
committerhniksic <devnull@localhost>
Sun, 18 Nov 2001 02:36:30 +0000 (18:36 -0800)
Published in <sxs4rnsdcw1.fsf@florida.arsdigita.de>.

src/ChangeLog
src/http.c

index f1cee06f91c7a12f370c84f522bf828be85d10e1..a703c45b0de8c7489d1c8a3538f55f3bf7fab89f 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-18  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * http.c (gethttp): Print the whole response line when printing
+       headers is requested.
+
 2001-05-12  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * res.c: New file.  Implement all RES-related code here.
index cfd2385237c9f3f2b4033c65af5945bcd907f9ef..023c753cb164ba5f9a4292203c43d52cdc77ed8f 100644 (file)
@@ -939,10 +939,6 @@ Accept: %s\r\n\
          all_headers[all_length] = '\0';
        }
 
-      /* Print the header if requested.  */
-      if (opt.server_response && hcount != 1)
-       logprintf (LOG_VERBOSE, "\n%d %s", hcount, hdr);
-
       /* Check for status line.  */
       if (hcount == 1)
        {
@@ -973,7 +969,12 @@ Accept: %s\r\n\
              && !opt.debug
 #endif
              )
-           logprintf (LOG_VERBOSE, "%d %s", statcode, error);
+           {
+             if (opt.server_response)
+              logprintf (LOG_VERBOSE, "\n%2d %s", hcount, hdr);
+             else
+              logprintf (LOG_VERBOSE, "%2d %s", statcode, error);
+           }
 
          goto done_header;
        }
@@ -985,6 +986,10 @@ Accept: %s\r\n\
          break;
        }
 
+      /* Print the header if requested.  */
+      if (opt.server_response && hcount != 1)
+       logprintf (LOG_VERBOSE, "\n%2d %s", hcount, hdr);
+
       /* Try getting content-length.  */
       if (contlen == -1 && !opt.ignore_length)
        if (header_process (hdr, "Content-Length", header_extract_number,