From 023d4e7a8fd81909b7acab3e8fee53411a6c3f58 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 3 Sep 2026 17:55:47 +0200 Subject: [PATCH] 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. --- src/h3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.3