From: Willy Tarreau Date: Sat, 30 Dec 2017 16:08:46 +0000 (+0100) Subject: DEBUG: hpack: make hpack_dht_dump() expose the output file X-Git-Tag: v1.9-dev1~535 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f03436c48cade33987397a619802f2b3aac39fd;p=thirdparty%2Fhaproxy.git DEBUG: hpack: make hpack_dht_dump() expose the output file It's more convenient to be able to choose between stdout and stderr. --- diff --git a/src/hpack-tbl.c b/src/hpack-tbl.c index 06798dc51a..92601f3f90 100644 --- a/src/hpack-tbl.c +++ b/src/hpack-tbl.c @@ -111,7 +111,7 @@ static inline unsigned int hpack_dht_get_tail(const struct hpack_dht *dht) #ifdef DEBUG_HPACK /* dump the whole dynamic header table */ -static void hpack_dht_dump(const struct hpack_dht *dht) +static void hpack_dht_dump(FILE *out, const struct hpack_dht *dht) { int i; unsigned int slot; @@ -119,7 +119,7 @@ static void hpack_dht_dump(const struct hpack_dht *dht) for (i = HPACK_SHT_SIZE; i < HPACK_SHT_SIZE + dht->used; i++) { slot = (hpack_get_dte(dht, i - HPACK_SHT_SIZE + 1) - dht->dte); - fprintf(stderr, "idx=%d slot=%u name=<%s> value=<%s> addr=%u-%u\n", + fprintf(out, "idx=%d slot=%u name=<%s> value=<%s> addr=%u-%u\n", i, slot, istpad(name, hpack_idx_to_name(dht, i)).ptr, istpad(value, hpack_idx_to_value(dht, i)).ptr,