From f3ce0418aaff9bb6291a94557421e79dd5f4abd3 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 24 Nov 2019 14:57:00 +0100 Subject: [PATCH] MINOR: mux-h2/trace: report the connection and/or stream error code We were missing the error code when tracing a call to h2s_error() or h2c_error(), let's report it when it's set. --- src/mux_h2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mux_h2.c b/src/mux_h2.c index 9502e0551..be9dae928 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -505,6 +505,9 @@ static void h2_trace(enum trace_level level, uint64_t mask, const struct trace_s if (src->verbosity > H2_VERB_CLEAN) { chunk_appendf(&trace_buf, " : h2c=%p(%c,%s)", h2c, conn_is_back(conn) ? 'B' : 'F', h2c_st_to_str(h2c->st0)); + if (h2c->errcode) + chunk_appendf(&trace_buf, " err=%s/%02x", h2_err_str(h2c->errcode), h2c->errcode); + if (h2c->dsi >= 0 && (mask & (H2_EV_RX_FRAME|H2_EV_RX_FHDR)) == (H2_EV_RX_FRAME|H2_EV_RX_FHDR)) { chunk_appendf(&trace_buf, " dft=%s/%02x", h2_ft_str(h2c->dft), h2c->dff); @@ -514,6 +517,8 @@ static void h2_trace(enum trace_level level, uint64_t mask, const struct trace_s if (h2s->id <= 0) chunk_appendf(&trace_buf, " dsi=%d", h2c->dsi); chunk_appendf(&trace_buf, " h2s=%p(%d,%s)", h2s, h2s->id, h2s_st_to_str(h2s->st)); + if (h2s->id && h2s->errcode) + chunk_appendf(&trace_buf, " err=%s/%02x", h2_err_str(h2s->errcode), h2s->errcode); } }