From 96598f9980ed95b832b72c85ce88d43b11760520 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 21 Dec 2023 11:15:19 +0100 Subject: [PATCH] BUG/MINOR: mux-quic: disable fast-fwd if connection on error Add a check on nego_ff to ensure connection is not on error. If this is the case, fast-forward is disable to prevent unnecessary sending. If snd_buf is latter called, stconn will be notified of the error to interrupt the stream. This check is necessary to ensure snd_buf and nego_ff are consistent. Note that previously, if fast-forward was conducted even on connection error, no sending would occur as qcc_io_send() also check these flags. However, there is a risk that stconn is never notified of the error status, thus it is considered as a bug. Its impact is minimal for now as fast-forward is disable by default on QUIC. By fixing it, it should be possible to reactive it soon. This should be backported up to 2.9. (cherry picked from commit 19f4f4d890bc28bbe4b850e1ced9be399f59fafb) Signed-off-by: Christopher Faulet --- src/mux_quic.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mux_quic.c b/src/mux_quic.c index d4d011e..ea88090 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2845,6 +2845,15 @@ static size_t qmux_nego_ff(struct stconn *sc, struct buffer *input, size_t count goto end; } + if (qcs->qcc->flags & (QC_CF_ERR_CONN|QC_CF_ERRL)) { + /* Disable fast-forward if connection is on error. Eventually, + * error will be reported to stream-conn if snd_buf is invoked. + */ + TRACE_DEVEL("connection in error", QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs); + qcs->sd->iobuf.flags |= IOBUF_FL_NO_FF; + goto end; + } + /* Alawys disable splicing */ qcs->sd->iobuf.flags |= IOBUF_FL_NO_SPLICING; -- 1.7.10.4