]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: fix the "show fd" dest buffer for the subscriber
authorWilly Tarreau <w@1wt.eu>
Thu, 1 Sep 2022 16:02:15 +0000 (18:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Sep 2022 12:23:56 +0000 (14:23 +0200)
Commit 98e40b981 ("MINOR: mux-h2: make the "show fd" helper also decode
the h2s subscriber when known") improved the output of "show fd" for the
H2 mux, but the output is sent to the trash buffer instead of the msg
argument. It turns out that this has no effect right now as the caller
passes the trash but this is risky.

This should be backported to 2.4.

src/mux_h2.c

index 4970fa326ce1fd82e36dc35d45e1435249e34c72..5d8cb9d28a30698ea13e4880c91b064c64d38f61 100644 (file)
@@ -6800,16 +6800,16 @@ static int h2_show_fd(struct buffer *msg, struct connection *conn)
                chunk_appendf(msg, "sd=%p", h2s->sd);
                chunk_appendf(msg, "(.flg=0x%08x)", se_fl_get(h2s->sd));
 
-               chunk_appendf(&trash, " .subs=%p", h2s->subs);
+               chunk_appendf(msg, " .subs=%p", h2s->subs);
                if (h2s->subs) {
-                       chunk_appendf(&trash, "(ev=%d tl=%p", h2s->subs->events, h2s->subs->tasklet);
-                       chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
+                       chunk_appendf(msg, "(ev=%d tl=%p", h2s->subs->events, h2s->subs->tasklet);
+                       chunk_appendf(msg, " tl.calls=%d tl.ctx=%p tl.fct=",
                                      h2s->subs->tasklet->calls,
                                      h2s->subs->tasklet->context);
                        if (h2s->subs->tasklet->calls >= 1000000)
                                ret = 1;
-                       resolve_sym_name(&trash, NULL, h2s->subs->tasklet->process);
-                       chunk_appendf(&trash, ")");
+                       resolve_sym_name(msg, NULL, h2s->subs->tasklet->process);
+                       chunk_appendf(msg, ")");
                }
        }
        return ret;