From 37d78997ae90794b820da1c4263037f183aca24a Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 24 May 2023 10:49:44 +0200 Subject: [PATCH] MINOR: mux-quic: only set EOS on RESET_STREAM recv A recent review was done to rationalize ERR/EOS/EOI flags on stream endpoint. A common definition for both H1/H2/QUIC mux have been written in the following documentation : ./doc/internals/stconn-close.txt In QUIC it is possible to close each channels of a stream independently with RESET_STREAM and STOP_SENDING frames. When a RESET_STREAM is received, it indicates that the peer has ended its transmission in an abnormal way. However, it is still ready to receive. Previously, on RESET_STREAM reception, QUIC MUX set the ERR flag on stream-endpoint. However, according to the QUIC mechanism, it should be instead EOS but this was impossible due to a BUG_ON() which prevents EOS without EOI or ERR. This BUG_ON was only present because this case was never used before the introduction of QUIC. It was removed in a recent commit which allows us to now properly set EOS alone on RESET_STREAM reception. In practice, this change allows to continue to send data even after RESET_STREAM reception. However, currently browsers always emit it with a STOP_SENDING as this is used to abort the whole H3 streams. In the end this will result in a stream-endpoint with EOS and ERR_PENDING/ERR flags. This should be backported up to 2.7. --- src/mux_quic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mux_quic.c b/src/mux_quic.c index ed1d6a360..99cb37f06 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -1307,7 +1307,7 @@ int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t f qc_free_ncbuf(qcs, &qcs->rx.ncbuf); if (qcs_sc(qcs)) { - se_fl_set_error(qcs->sd); + se_fl_set(qcs->sd, SE_FL_EOS); qcs_alert(qcs); }