From: Amaury Denoyelle Date: Fri, 5 Jun 2026 08:02:31 +0000 (+0200) Subject: OPTIM: mux_quic: remove QCS from recv_list on reset X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a39b1a40ad946f095c5344bc23208461e32cda00;p=thirdparty%2Fhaproxy.git OPTIM: mux_quic: remove QCS from recv_list on reset When a RESET_STREAM is received, QCS Rx channel is closed and pending Rx data and buf are cleared without being transmitted to upper stream layer. This patch complements this by removing the QCS from recv_list if present in it. This is a small optimization nothing would be performed for such QCS on qcc_io_recv(). --- diff --git a/src/mux_quic.c b/src/mux_quic.c index f1187cdfe..a6c4983f7 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2333,6 +2333,9 @@ int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t f goto err; } + qcs->flags |= QC_SF_SIZE_KNOWN|QC_SF_RECV_RESET; + qcs_close_remote(qcs); + /* RFC 9000 3.2. Receiving Stream States * * An @@ -2340,14 +2343,15 @@ int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t f * data that was not consumed, and signal the receipt of the * RESET_STREAM. */ - qcs->flags |= QC_SF_SIZE_KNOWN|QC_SF_RECV_RESET; - qcs_close_remote(qcs); while (!eb_is_empty(&qcs->rx.bufs)) { b = container_of(eb64_first(&qcs->rx.bufs), struct qc_stream_rxbuf, off_node); qcs_free_rxbuf(qcs, b); } + /* Remove stream from recv_list if present. */ + LIST_DEL_INIT(&qcs->el_recv); + out: if (qcc->glitches != prev_glitches && !(qcc->flags & QC_CF_IS_BACK)) session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches);