From 6ef5baa07be849fc014b58bd9cee781144a9ac19 Mon Sep 17 00:00:00 2001 From: hniksic Date: Sat, 17 Nov 2001 18:36:30 -0800 Subject: [PATCH] [svn] Prettier printing of HTTP headers. Published in . --- src/ChangeLog | 5 +++++ src/http.c | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f1cee06f..a703c45b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-11-18 Hrvoje Niksic + + * http.c (gethttp): Print the whole response line when printing + headers is requested. + 2001-05-12 Hrvoje Niksic * res.c: New file. Implement all RES-related code here. diff --git a/src/http.c b/src/http.c index cfd23852..023c753c 100644 --- a/src/http.c +++ b/src/http.c @@ -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,