MINOR: mux-quic: store session in QCS instance

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.
This commit is contained in:
Amaury Denoyelle 2025-07-22 18:27:40 +02:00
parent 826f797bb0
commit 3bf37596ba
2 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include <haproxy/quic_pacing-t.h> #include <haproxy/quic_pacing-t.h>
#include <haproxy/quic_stream-t.h> #include <haproxy/quic_stream-t.h>
#include <haproxy/quic_utils-t.h> #include <haproxy/quic_utils-t.h>
#include <haproxy/session-t.h>
#include <haproxy/stconn-t.h> #include <haproxy/stconn-t.h>
#include <haproxy/task-t.h> #include <haproxy/task-t.h>
#include <haproxy/time-t.h> #include <haproxy/time-t.h>
@ -146,6 +147,7 @@ struct qc_stream_rxbuf {
struct qcs { struct qcs {
struct qcc *qcc; struct qcc *qcc;
struct session *sess; /* only set for backend conns */
struct sedesc *sd; struct sedesc *sd;
uint32_t flags; /* QC_SF_* */ uint32_t flags; /* QC_SF_* */
enum qcs_state st; /* QC_SS_* state */ enum qcs_state st; /* QC_SS_* state */

View File

@ -134,6 +134,7 @@ static struct qcs *qcs_new(struct qcc *qcc, uint64_t id, enum qcs_type type)
qcs->stream = NULL; qcs->stream = NULL;
qcs->qcc = qcc; qcs->qcc = qcc;
qcs->sess = NULL;
qcs->sd = NULL; qcs->sd = NULL;
qcs->flags = QC_SF_NONE; qcs->flags = QC_SF_NONE;
qcs->st = QC_SS_IDLE; qcs->st = QC_SS_IDLE;
@ -3661,6 +3662,7 @@ static int qmux_init(struct connection *conn, struct proxy *prx,
goto err; goto err;
} }
qcs->sess = sess;
qcs->sd = sc->sedesc; qcs->sd = sc->sedesc;
qcc->nb_sc++; qcc->nb_sc++;
} }
@ -3720,6 +3722,7 @@ static int qmux_strm_attach(struct connection *conn, struct sedesc *sd, struct s
return -1; return -1;
} }
qcs->sess = sess;
qcs->sd = sd->sc->sedesc; qcs->sd = sd->sc->sedesc;
qcc->nb_sc++; qcc->nb_sc++;