]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Initialize the session before starting the xprt.
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 27 May 2021 15:12:36 +0000 (17:12 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
We must ensure the session and the mux are initialized before starting the xprt.

src/quic_sock.c

index 011b93ad6de10a6ec9568a9145301b2c472a99b7..aee5ce24b9b645067cc41fa825f7deb13b517194 100644 (file)
@@ -57,16 +57,16 @@ int quic_session_accept(struct connection *cli_conn)
                        goto out_free_conn;
        }
 
-       if (conn_xprt_start(cli_conn) < 0)
-               goto out_free_conn;
-
        sess = session_new(p, l, &cli_conn->obj_type);
        if (!sess)
                goto out_free_conn;
 
        conn_set_owner(cli_conn, sess, NULL);
 
-       if (conn_complete_session(cli_conn) >= 0)
+       if (conn_complete_session(cli_conn) < 0)
+               goto out_free_sess;
+
+       if (conn_xprt_start(cli_conn) >= 0)
                return 1;
 
  out_free_sess: