From: Amaury Denoyelle Date: Thu, 22 Oct 2026 08:04:23 +0000 (+0200) Subject: BUG/MEDIUM: mux_quic: fix FIN received with an already known offset X-Git-Tag: v3.5-dev10~77 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=59f8449e0cf2ef964ee08a596f4a62dd06e05f40;p=haproxy.git BUG/MEDIUM: mux_quic: fix FIN received with an already known offset The following patch improves STREAM FIN handling on received frames by reducing the invokation of the parser. It requires to detect the case where FIN is received standalone without any data, 7dd1eec2b10bd13f05c792ec0e053c19aac952ee MINOR: mux-quic: refine reception of standalone STREAM FIN This introduces an issue when STREAM FIN is received with an already known offset. In this case, FIN is not considered standalone. However, as the offset was already handled, parser is skipped and this prevents closure of the stream Rx channel until its timeout. Fix this by marking FIN as standalone after skipping already received offset. Thus, if is reduced to 0 in qcc_recv(), will be set even if it was received with a payload. This must be backported up to 3.2, which introduced the above patch. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index 2c55a0cba..97d4b871e 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -1996,7 +1996,7 @@ static struct qc_stream_rxbuf *qcs_get_rxbuf(struct qcs *qcs, uint64_t offset, int qcc_recv(struct qcc *qcc, uint64_t id, uint64_t len, uint64_t offset, char fin, char *data) { - const int fin_standalone = (!len && fin); + int fin_standalone; struct qcs *qcs; enum ncb_ret ncb_ret; uint64_t left; @@ -2086,6 +2086,9 @@ int qcc_recv(struct qcc *qcc, uint64_t id, uint64_t len, uint64_t offset, offset = qcs->rx.offset; } + /* If FIN received with an already known offset, fin_standalone must be set as well. */ + fin_standalone = (!len && fin); + if (len && (qcc->flags & QC_CF_WAIT_HS)) { if (!(qcc->conn->flags & CO_FL_EARLY_DATA)) { /* Ensure 'Early-data: 1' will be set on the request. */