From: Amaury Denoyelle Date: Thu, 3 Sep 2026 15:55:47 +0000 (+0200) Subject: BUG/MINOR: h3: only increment frame type counter on new header X-Git-Tag: v3.5-dev7~53 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=023d4e7a8fd81909b7acab3e8fee53411a6c3f58;p=haproxy.git BUG/MINOR: h3: only increment frame type counter on new header For every new HTTP/3 received frame, a counter related to the frame type is incremented. This operation is performed directly in h3_rcv_buf() parsing loop. Prior to this patch, increment would be called too many times when dealing with large frames. Fix this by ensuring that the increment is only reported once per frame. This is now performed directly after HTTP/3 frame header parsing. This must be backported up to 2.6. --- diff --git a/src/h3.c b/src/h3.c index 01f723bda..69cc9e530 100644 --- a/src/h3.c +++ b/src/h3.c @@ -1992,6 +1992,7 @@ static ssize_t h3_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) h3s->demux_frame_len = flen; total += hlen; TRACE_PROTO("parsing a new frame", H3_EV_RX_FRAME, qcs->qcc->conn, qcs); + h3_inc_frame_type_cnt(h3c->prx_counters, ftype); if ((ret = h3_check_frame_valid(h3c, qcs, ftype))) { TRACE_ERROR("received an invalid frame", H3_EV_RX_FRAME, qcs->qcc->conn, qcs); @@ -2074,7 +2075,6 @@ static ssize_t h3_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) if (last_stream_frame && h3s->flags & H3_SF_HAVE_CLEN && h3_check_body_size(qcs, last_stream_frame)) break; - h3_inc_frame_type_cnt(h3c->prx_counters, ftype); switch (ftype) { case H3_FT_DATA: ret = h3_data_to_htx(qcs, b, flen, last_stream_frame);