From: Amaury Denoyelle Date: Fri, 9 Oct 2026 07:51:46 +0000 (+0200) Subject: BUG/MINOR: mux_quic: do not crash on SE_SHR_DRAIN shut X-Git-Tag: v3.5-dev10~173 X-Git-Url: https://git.kaiwu.me/$%7BGITURL%7D/doc/static/gitweb.js?a=commitdiff_plain;h=4939dc475c5681f190200e006338768903b08c49;p=haproxy.git BUG/MINOR: mux_quic: do not crash on SE_SHR_DRAIN shut qcm_strm_shut() callback was extended to ensure stream is properly closed. Only SE_SHR_DRAIN mode was left unsupported as it was considered not possible to encounter it. As such a BUG_ON() was added in shut callback. Since QUIC backend support, SE_SHR_DRAIN may be used on shut for checks. As such, it is required to properly handle it. This patch removes the BUG_ON() and treat SE_SHR_DRAIN similarly to SE_SHR_RESET. This must be backported up to 3.3. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index 7af0ac303..69315cba3 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -4814,9 +4814,6 @@ static void qcm_strm_shut(struct stconn *sc, unsigned int mode, struct se_abort_ TRACE_ENTER(QMUX_EV_STRM_SHUT, qcc->conn, qcs); - /* Not implemented. */ - BUG_ON(mode & SE_SHR_DRAIN); - /* Early closure reported if QC_SF_FIN_STREAM not yet set. */ if ((mode & (SE_SHW_SILENT|SE_SHW_NORMAL)) && !qcs_is_close_local(qcs) && @@ -4833,7 +4830,7 @@ static void qcm_strm_shut(struct stconn *sc, unsigned int mode, struct se_abort_ tasklet_wakeup(qcc->wait_event.tasklet); } - if ((mode & SE_SHR_RESET) && + if ((mode & (SE_SHR_RESET|SE_SHR_DRAIN)) && !qcs_is_close_remote(qcs) && !(qcs->flags & (QC_SF_READ_ABORTED))) { qcc->app_ops->lclose(qcs, QCC_APP_OPS_LCLO_MODE_READ); }