]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2/traces: bring back the lost "sent H2 REQ/RES" traces
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Jun 2021 06:40:04 +0000 (08:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Jun 2021 06:43:43 +0000 (08:43 +0200)
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

index e09b0d97d655415a31b9ce61a51f73da6c5cd050..9cb6eba758b1ab69cd7e8266f580f3e62b20b553 100644 (file)
@@ -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;