[master] 8d0cb3f5c vtc_http2: Print headers as "name: value"

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Apr 4 14:29:11 UTC 2024


commit 8d0cb3f5c54a2900de3311f340d6024b3cc7aa5e
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Wed Mar 27 11:54:43 2024 +0100

    vtc_http2: Print headers as "name: value"
    
    The extra space before the colon looked uncanny. The rest is just code
    indentation improvements.
    
    Better diff with the --ignore-all-space --word-diff options.

diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index 93c7d6508..1d401ed17 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -467,22 +467,20 @@ decode_hdr(struct http *hp, struct hpk_hdr *h, const struct vsb *vsb)
 		r = HPK_DecHdr(iter, h + n);
 		if (r == hpk_err )
 			break;
-		vtc_log(hp->vl, 4,
-				"header[%2d]: %s : %s",
-				n,
-				h[n].key.ptr,
-				h[n].value.ptr);
+		vtc_log(hp->vl, 4, "header[%2d]: %s: %s",
+		    n, h[n].key.ptr, h[n].value.ptr);
 		n++;
 		if (r == hpk_done)
 			break;
 	}
 
-	if (r != hpk_done)
+	if (r != hpk_done) {
 		vtc_log(hp->vl, hp->fatal ? 4 : 0,
-				"Header decoding failed (%d) %d", r, hp->fatal);
-	else if (n == MAX_HDR)
+		    "Header decoding failed (%d) %d", r, hp->fatal);
+	} else if (n == MAX_HDR) {
 		vtc_log(hp->vl, hp->fatal,
-				"Max number of headers reached (%d)", MAX_HDR);
+		    "Max number of headers reached (%d)", MAX_HDR);
+	}
 
 	HPK_FreeIter(iter);
 }


More information about the varnish-commit mailing list