]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: mux_quic: do not crash on SE_SHR_DRAIN shut
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 9 Oct 2026 07:51:46 +0000 (09:51 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 16 Oct 2026 08:19:23 +0000 (10:19 +0200)
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.

src/mux_quic.c

index 7af0ac3039b690628adb969d901f60c135ca13ad..69315cba34f4b4f19aeed68d3d5643aa58d62c53 100644 (file)
@@ -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);
        }