]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2/trace: report h2s->id before h2c->dsi for the stream ID
authorWilly Tarreau <w@1wt.eu>
Fri, 30 Aug 2019 05:28:24 +0000 (07:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 30 Aug 2019 05:39:59 +0000 (07:39 +0200)
h2c->dsi is only for demuxing, and needed while decoding a new request.
But if we already have a valid stream ID (e.g. response or outgoing
request), we should use it instead. This avoids seeing [0] in front of
the responses at user level.

src/mux_h2.c

index 1023d20fb52f431d0a34c8a4c61e50297d825ab7..7b4f085d12569041eca5a4dea6cdefe9925a375f 100644 (file)
@@ -532,13 +532,13 @@ static void h2_trace(enum trace_level level, uint64_t mask, const struct trace_s
 
                if (type == HTX_BLK_REQ_SL)
                        chunk_appendf(&trace_buf, " : [%d] H2 REQ: %.*s %.*s %.*s",
-                                     h2c->dsi,
+                                     h2s ? h2s->id : h2c->dsi,
                                      HTX_SL_P1_LEN(sl), HTX_SL_P1_PTR(sl),
                                      HTX_SL_P2_LEN(sl), HTX_SL_P2_PTR(sl),
                                      HTX_SL_P3_LEN(sl), HTX_SL_P3_PTR(sl));
                else if (type == HTX_BLK_RES_SL)
                        chunk_appendf(&trace_buf, " : [%d] H2 RES: %.*s %.*s %.*s",
-                                     h2c->dsi,
+                                     h2s ? h2s->id : h2c->dsi,
                                      HTX_SL_P1_LEN(sl), HTX_SL_P1_PTR(sl),
                                      HTX_SL_P2_LEN(sl), HTX_SL_P2_PTR(sl),
                                      HTX_SL_P3_LEN(sl), HTX_SL_P3_PTR(sl));