]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
OPTIM: mux_quic: remove QCS from recv_list on reset
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 5 Jun 2026 08:02:31 +0000 (10:02 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 5 Jun 2026 13:42:44 +0000 (15:42 +0200)
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().

src/mux_quic.c

index f1187cdfeac582be905150df40222572d83448c9..a6c4983f7bc56463979a4a1b2d31c8b97e21a872 100644 (file)
@@ -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);