From: Amaury Denoyelle Date: Tue, 22 Jul 2025 16:27:40 +0000 (+0200) Subject: MINOR: mux-quic: store session in QCS instance X-Git-Tag: v3.3-dev4~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3bf37596bac7afe3e9f6deb43db6aa8667041930;p=thirdparty%2Fhaproxy.git MINOR: mux-quic: store session in QCS instance Add a new 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. 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. --- diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index 906b383f2..34df2c7d9 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -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 */ diff --git a/src/mux_quic.c b/src/mux_quic.c index 7222a9f4d..a65b564b9 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -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++;