]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: session: support QMux in clear on FE side
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 29 Apr 2026 13:10:44 +0000 (15:10 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 21 May 2026 13:09:10 +0000 (15:09 +0200)
Activates xprt_qmux layer if necessary via session_accept_fd(). This is
necessary to be able to support QMux in clear. This operation is noop if
SSL is active, as in this case xprt_qmux will be activated after the SSL
handshake completion.

To ensure MUX init is delayed when running with clear QMux, mask
CO_FL_WAIT_XPRT_L6 is added to test if the embryonic task must be
started instead.

src/session.c

index a9c8c6d8505c6c4bf88a96b7c413f941a6c97cf2..d5bd4ea9581df199b9d5bf0e1118dfc76ca15215 100644 (file)
@@ -241,14 +241,17 @@ int session_accept_fd(struct connection *cli_conn)
                if (l->bind_conf->options & BC_O_ACC_CIP)
                        cli_conn->flags |= CO_FL_ACCEPT_CIP;
 
-               if (l->bind_conf->mux_proto && l->bind_conf->mux_proto->init_xprt == XPRT_QMUX)
-                       cli_conn->flags |= (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
-
                /* Add the handshake pseudo-XPRT */
                if (cli_conn->flags & (CO_FL_ACCEPT_PROXY | CO_FL_ACCEPT_CIP)) {
                        if (xprt_add_hs(cli_conn) != 0)
                                goto out_free_conn;
                }
+
+               /* Add handshake layer prior to MUX init if required. Does nothing if SSL layer is active though. */
+               if (l->bind_conf->mux_proto && l->bind_conf->mux_proto->init_xprt) {
+                       if (xprt_add_l6hs(cli_conn, l->bind_conf->mux_proto->init_xprt))
+                               goto out_free_conn;
+               }
        }
 
        /* Reversed conns already have an assigned session, do not recreate it. */
@@ -351,7 +354,7 @@ int session_accept_fd(struct connection *cli_conn)
         *           v       |           |        |
         *          conn -- owner ---> task <-----+
         */
-       if (cli_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)) {
+       if (cli_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS | CO_FL_WAIT_XPRT_L6)) {
                int timeout;
                int clt_tmt = p->timeout.client;
                int hs_tmt = p->timeout.client_hs;