]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hpack: fix debugging output of pseudo header names
authorWilly Tarreau <w@1wt.eu>
Sun, 3 Dec 2017 08:43:38 +0000 (09:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 3 Dec 2017 08:43:38 +0000 (09:43 +0100)
When a pseudo header is used, name.ptr is NULL and we must replace it
with hpack_idx_to_name(). This only affects code built with DEBUG_HPACK.

To be backported to 1.8.

src/hpack-dec.c

index eadb6deb4f7952c262f99e81242f659c7c27c3f7..1a776bca76c8d0df745a5c153d4c3c01afbae8be 100644 (file)
@@ -376,7 +376,7 @@ int hpack_decode_frame(struct hpack_dht *dht, const uint8_t *raw, uint32_t len,
                }
 
                hpack_debug_printf("\e[1;34m%s\e[0m: ",
-                                  istpad(trash.str, name).ptr);
+                                  istpad(trash.str, name.ptr ? name : hpack_idx_to_name(dht, idx)).ptr);
 
                hpack_debug_printf("\e[1;35m%s\e[0m [idx=%d, used=%d]\n",
                                   istpad(trash.str, value).ptr,