From 3a53707160c90101722c08438721304b8c89e84c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 17 Jun 2021 08:40:04 +0200 Subject: [PATCH] BUG/MINOR: mux-h2/traces: bring back the lost "sent H2 REQ/RES" traces In 2.4, commit d1ac2b90c ("MAJOR: htx: Remove the EOM block type and use HTX_FL_EOM instead") changed the HTX processing to destroy the blocks as they are processed. So the traces that were emitted at the end of the send headers functions didn't have anything to show. Let's move these traces earlier in the function, right before the HTX processing, so that everything is still in place. This should be backported to 2.4. --- src/mux_h2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mux_h2.c b/src/mux_h2.c index e09b0d97d6..9cb6eba758 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -5131,6 +5131,8 @@ static size_t h2s_frt_make_resp_headers(struct h2s *h2s, struct htx *htx) } } + TRACE_USER("sent H2 response ", H2_EV_TX_FRAME|H2_EV_TX_HDR, h2c->conn, h2s, htx); + /* remove all header blocks including the EOH and compute the * corresponding size. */ @@ -5161,7 +5163,6 @@ static size_t h2s_frt_make_resp_headers(struct h2s *h2s, struct htx *htx) outbuf.area[4] |= H2_F_HEADERS_END_STREAM; /* commit the H2 response */ - TRACE_USER("sent H2 response ", H2_EV_TX_FRAME|H2_EV_TX_HDR, h2c->conn, h2s, htx); b_add(mbuf, outbuf.data); /* indicates the HEADERS frame was sent, except for 1xx responses. For @@ -5538,6 +5539,8 @@ static size_t h2s_bck_make_req_headers(struct h2s *h2s, struct htx *htx) } } + TRACE_USER("sent H2 request ", H2_EV_TX_FRAME|H2_EV_TX_HDR, h2c->conn, h2s, htx); + /* remove all header blocks including the EOH and compute the * corresponding size. */ @@ -5568,7 +5571,6 @@ static size_t h2s_bck_make_req_headers(struct h2s *h2s, struct htx *htx) outbuf.area[4] |= H2_F_HEADERS_END_STREAM; /* commit the H2 response */ - TRACE_USER("sent H2 request ", H2_EV_TX_FRAME|H2_EV_TX_HDR, h2c->conn, h2s, htx); b_add(mbuf, outbuf.data); h2s->flags |= H2_SF_HEADERS_SENT; h2s->st = H2_SS_OPEN;