]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: store session in QCS instance
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 22 Jul 2025 16:27:40 +0000 (18:27 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 23 Jul 2025 13:42:37 +0000 (15:42 +0200)
Add a new <sess> member into QCS structure. It is used to store the
parent session of the stream on attach operation. This is only done for
backend side.

This new member will become necessary when connection reuse will be
implemented. <owner> member of connection is not suitable as it could be
set to NULL, notably after a session_add_conn() failure.

Also, a single BE conn can be shared along different session instance,
in particular when using aggressive/always reuse mode. Thus it is
necessary to linked each QCS instance with its session.

include/haproxy/mux_quic-t.h
src/mux_quic.c

index 906b383f2e5090d4e9ef9286c4706db3c78d6073..34df2c7d9944fec56deb717e0a14a60f50dad4c4 100644 (file)
@@ -18,6 +18,7 @@
 #include <haproxy/quic_pacing-t.h>
 #include <haproxy/quic_stream-t.h>
 #include <haproxy/quic_utils-t.h>
+#include <haproxy/session-t.h>
 #include <haproxy/stconn-t.h>
 #include <haproxy/task-t.h>
 #include <haproxy/time-t.h>
@@ -146,6 +147,7 @@ struct qc_stream_rxbuf {
 
 struct qcs {
        struct qcc *qcc;
+       struct session *sess; /* only set for backend conns */
        struct sedesc *sd;
        uint32_t flags;      /* QC_SF_* */
        enum qcs_state st;   /* QC_SS_* state */
index 7222a9f4d2340a7b187911ea261cc5a3099432e9..a65b564b9fd38f0a49394a0958f3ab44f28bf265 100644 (file)
@@ -134,6 +134,7 @@ static struct qcs *qcs_new(struct qcc *qcc, uint64_t id, enum qcs_type type)
 
        qcs->stream = NULL;
        qcs->qcc = qcc;
+       qcs->sess = NULL;
        qcs->sd = NULL;
        qcs->flags = QC_SF_NONE;
        qcs->st = QC_SS_IDLE;
@@ -3661,6 +3662,7 @@ static int qmux_init(struct connection *conn, struct proxy *prx,
                        goto err;
                }
 
+               qcs->sess = sess;
                qcs->sd = sc->sedesc;
                qcc->nb_sc++;
        }
@@ -3720,6 +3722,7 @@ static int qmux_strm_attach(struct connection *conn, struct sedesc *sd, struct s
                return -1;
        }
 
+       qcs->sess = sess;
        qcs->sd = sd->sc->sedesc;
        qcc->nb_sc++;