]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2/trace: report the connection and/or stream error code
authorWilly Tarreau <w@1wt.eu>
Sun, 24 Nov 2019 13:57:00 +0000 (14:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Nov 2019 10:34:26 +0000 (11:34 +0100)
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

index 9502e05513223963856f91a70915a471441c334b..be9dae928a260dab2eaf707d2de3c15d9a067f5b 100644 (file)
@@ -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);
                }
        }