From d590958a5af00796391d39c54e85eeb47509102d Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 26 Nov 2021 17:31:35 +0100 Subject: [PATCH] MINOR: mux-h1: Improve H1 traces by adding info about http parsers Info about the request and the response parsers are now displayed in H1 traces for advanced and complete verbosity only. This should help debugging. This patch may be backported as far as 2.4. (cherry picked from commit 6580f2868e8828a8ea1c9e4a6481c9e54abfdd25) Signed-off-by: Christopher Faulet --- src/mux_h1.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mux_h1.c b/src/mux_h1.c index 5c36d58..89db65e 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -299,10 +299,19 @@ static void h1_trace(enum trace_level level, uint64_t mask, const struct trace_s chunk_appendf(&trace_buf, " : [%c]", ((h1c->flags & H1C_F_IS_BACK) ? 'B' : 'F')); /* Display request and response states if h1s is defined */ - if (h1s) + if (h1s) { chunk_appendf(&trace_buf, " [%s, %s]", h1m_state_str(h1s->req.state), h1m_state_str(h1s->res.state)); + if (src->verbosity > H1_VERB_SIMPLE) { + chunk_appendf(&trace_buf, " - req=(.fl=0x%08x .curr_len=%lu .body_len=%lu)", + h1s->req.flags, (unsigned long)h1s->req.curr_len, (unsigned long)h1s->req.body_len); + chunk_appendf(&trace_buf, " res=(.fl=0x%08x .curr_len=%lu .body_len=%lu)", + h1s->res.flags, (unsigned long)h1s->res.curr_len, (unsigned long)h1s->res.body_len); + } + + } + if (src->verbosity == H1_VERB_CLEAN) return; -- 1.7.10.4