From d18025eeef03dd82d60860d60245c93dc4feadb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 20 Jan 2023 15:33:50 +0100 Subject: [PATCH] BUG/MINOR: quic: Do not request h3 clients to close its unidirection streams It is forbidden to request h3 clients to close its Control and QPACK unidirection streams. If not, the client closes the connection with H3_CLOSED_CRITICAL_STREAM(0x104). Perhaps this could prevent some clients as Chrome to come back for a while. But at quic_conn level there is no mean to identify the streams for which we cannot send STOP_SENDING frame. Such a possibility is even not mentionned in RFC 9000. At this time there is no choice than stopping sending STOP_SENDING frames for all the h3 unidirectional streams inspecting the ->app_opps quic_conn value. Must be backported to 2.7 and 2.6. --- src/quic_conn.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/quic_conn.c b/src/quic_conn.c index d4a9c18f5..795c1ab92 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -2836,6 +2836,17 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt, } else { TRACE_DEVEL("No mux for new stream", QUIC_EV_CONN_PRSHPKT, qc); + if (qc->app_ops == &h3_ops && quic_stream_is_uni(stream->id)) { + /* Do not send STOP_SENDING frames for h3 unidirectional streams. + * TODO: this test should be removed when the connection closure + * will be more clean. + * At quic_conn level there is no mean to know that an application + * want to forbid stream closure requests to receivers. This is the + * case for the Control and QPACK h3 unidirectional streams. + */ + goto leave; + } + if (!qc_stop_sending_frm_enqueue(qc, stream->id)) TRACE_ERROR("could not enqueue STOP_SENDING frame", QUIC_EV_CONN_PRSHPKT, qc); /* This packet will not be acknowledged */