]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: mux-h2: also count glitches on invalid trailers
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Feb 2026 21:02:13 +0000 (22:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Feb 2026 21:03:16 +0000 (22:03 +0100)
Two cases were not causing glitches to be incremented:
  - invalid trailers
  - trailers on closed streams

This patch addresses this. It could be backported, at least to 3.2.

src/mux_h2.c

index c2fb15efc34eabac2e52bc5c12302926259c9374..9bcf62532f8e951763dc360941354d2e7e6501e7 100644 (file)
@@ -3514,6 +3514,7 @@ static struct h2s *h2c_frt_handle_headers(struct h2c *h2c, struct h2s *h2s)
                error = h2c_dec_hdrs(h2c, &rxbuf, &flags, &body_len, NULL);
                sess_log(h2c->conn->owner);
                h2s = (struct h2s*)h2_error_stream;
+               h2c_report_glitch(h2c, 1, "rcvd H2 trailers on closed stream");
                TRACE_USER("rcvd H2 trailers on closed stream", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_STRM_NEW|H2_EV_STRM_END, h2c->conn, h2s, &rxbuf);
                goto send_rst;
        }
@@ -6312,6 +6313,7 @@ next_frame:
 
        /* Trailers terminate a DATA sequence */
        if (h2_make_htx_trailers(list, htx) <= 0) {
+               h2c_report_glitch(h2c, 1, "failed to append HTX trailers into rxbuf");
                TRACE_STATE("failed to append HTX trailers into rxbuf", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_H2S_ERR, h2c->conn);
                htx->flags |= HTX_FL_PARSING_ERROR;
                goto fail;