MINOR: connection: rename QMux related flags

This is a follow-up on the QUIC MUX renaming process.

The current patch performs renaming of "qstrm" to "qmux" in connection
flags. These flags are only used in linked with the xprt_qmux layer.
This has an impact on every files which manipulates these flags, namely
backend, session and ssl_sock sources.

Also, internal xprt identifier is renamed from XPRT_QSTRM to XPRT_QMUX,
This commit is contained in:
Amaury Denoyelle 2026-05-11 10:49:15 +02:00
parent 96b72fd461
commit 1bb879cb3f
6 changed files with 25 additions and 25 deletions

View File

@ -130,8 +130,8 @@ enum {
CO_FL_OPT_TOS = 0x00000020, /* connection has a special sockopt tos */
CO_FL_QSTRM_SEND = 0x00000040, /* connection uses QMux protocol, needs to exchange transport parameters before starting mux layer */
CO_FL_QSTRM_RECV = 0x00000080, /* connection uses QMux protocol, needs to exchange transport parameters before starting mux layer */
CO_FL_QMUX_SEND = 0x00000040, /* connection uses QMux protocol, needs to exchange transport parameters before starting mux layer */
CO_FL_QMUX_RECV = 0x00000080, /* connection uses QMux protocol, needs to exchange transport parameters before starting mux layer */
/* These flags indicate whether the Control and Transport layers are initialized */
CO_FL_CTRL_READY = 0x00000100, /* FD was registered, fd_delete() needed */
@ -213,7 +213,7 @@ static forceinline char *conn_show_flags(char *buf, size_t len, const char *deli
/* flags */
_(CO_FL_SAFE_LIST, _(CO_FL_IDLE_LIST, _(CO_FL_CTRL_READY,
_(CO_FL_REVERSED, _(CO_FL_ACT_REVERSING, _(CO_FL_OPT_MARK, _(CO_FL_OPT_TOS,
_(CO_FL_QSTRM_SEND, _(CO_FL_QSTRM_RECV,
_(CO_FL_QMUX_SEND, _(CO_FL_QMUX_RECV,
_(CO_FL_XPRT_READY, _(CO_FL_WANT_DRAIN, _(CO_FL_WAIT_ROOM, _(CO_FL_SSL_NO_CACHED_INFO, _(CO_FL_EARLY_SSL_HS,
_(CO_FL_EARLY_DATA, _(CO_FL_SOCKS4_SEND, _(CO_FL_SOCKS4_RECV, _(CO_FL_SOCK_RD_SH,
_(CO_FL_SOCK_WR_SH, _(CO_FL_ERROR, _(CO_FL_FDLESS, _(CO_FL_WAIT_L4_CONN,
@ -285,7 +285,7 @@ enum {
CO_ER_SSL_FATAL, /* SSL fatal error during a SSL_read or SSL_write */
CO_ER_QSTRM, /* QMux transport parameter exchange failure */
CO_ER_QMUX, /* QMux transport parameter exchange failure */
CO_ER_REVERSE, /* Error during reverse connect */
@ -349,7 +349,7 @@ enum {
XPRT_SSL = 1,
XPRT_HANDSHAKE = 2,
XPRT_QUIC = 3,
XPRT_QSTRM = 4,
XPRT_QMUX = 4,
XPRT_ENTRIES /* must be last one */
};

View File

@ -2131,7 +2131,7 @@ int connect_server(struct stream *s)
}
if (srv && srv->mux_proto && isteq(srv->mux_proto->token, ist("qmux"))) {
srv_conn->flags |= (CO_FL_QSTRM_RECV|CO_FL_QSTRM_SEND);
srv_conn->flags |= (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
may_start_mux_now = 0;
}

View File

@ -196,7 +196,7 @@ int conn_notify_mux(struct connection *conn, int old_flags, int forced_wake)
* information to create one, typically from the ALPN. If we're
* done with the handshake, attempt to create one.
*/
if (unlikely(!conn->mux) && !(conn->flags & (CO_FL_WAIT_XPRT|CO_FL_QSTRM_RECV|CO_FL_QSTRM_SEND))) {
if (unlikely(!conn->mux) && !(conn->flags & (CO_FL_WAIT_XPRT|CO_FL_QMUX_RECV|CO_FL_QMUX_SEND))) {
ret = conn_create_mux(conn, NULL);
if (ret < 0)
goto done;
@ -888,7 +888,7 @@ const char *conn_err_code_str(struct connection *c)
case CO_ER_SSL_FATAL: return "SSL fatal error";
case CO_ER_QSTRM: return "Error during QMux transport parameters initial exchange";
case CO_ER_QMUX: return "Error during QMux transport parameters initial exchange";
case CO_ER_REVERSE: return "Reverse connect failure";

View File

@ -242,7 +242,7 @@ int session_accept_fd(struct connection *cli_conn)
cli_conn->flags |= CO_FL_ACCEPT_CIP;
if (l->bind_conf->mux_proto && isteq(l->bind_conf->mux_proto->token, ist("qmux")))
cli_conn->flags |= (CO_FL_QSTRM_RECV|CO_FL_QSTRM_SEND);
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)) {
@ -503,7 +503,7 @@ static void session_kill_embryonic(struct session *sess, unsigned int state)
conn->err_code == CO_ER_PRX_EMPTY || conn->err_code == CO_ER_PRX_ABORT ||
conn->err_code == CO_ER_CIP_EMPTY || conn->err_code == CO_ER_CIP_ABORT ||
conn->err_code == CO_ER_SSL_EMPTY || conn->err_code == CO_ER_SSL_ABORT ||
conn->err_code == CO_ER_QSTRM)
conn->err_code == CO_ER_QMUX)
log = 0;
}
@ -515,8 +515,8 @@ static void session_kill_embryonic(struct session *sess, unsigned int state)
conn->err_code = CO_ER_CIP_TIMEOUT;
else if (conn->flags & CO_FL_SSL_WAIT_HS)
conn->err_code = CO_ER_SSL_TIMEOUT;
else if (conn->flags & CO_FL_QSTRM_RECV)
conn->err_code = CO_ER_QSTRM;
else if (conn->flags & CO_FL_QMUX_RECV)
conn->err_code = CO_ER_QMUX;
}
sess_log_embryonic(sess);

View File

@ -6965,8 +6965,8 @@ struct task *ssl_sock_io_cb(struct task *t, void *context, unsigned int state)
int closed_connection = 0;
if (!ctx->conn->mux) {
if (ctx->conn->flags & (CO_FL_QSTRM_RECV|CO_FL_QSTRM_SEND)) {
const struct xprt_ops *ops = xprt_get(XPRT_QSTRM);
if (ctx->conn->flags & (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND)) {
const struct xprt_ops *ops = xprt_get(XPRT_QMUX);
void *xprt_ctx_hs = NULL;
ret = ops->init(conn, &xprt_ctx_hs);

View File

@ -121,7 +121,7 @@ int conn_recv_qstrm(struct connection *conn, struct xprt_qstrm_ctx *ctx, int fla
return 0;
fail:
conn->err_code = CO_ER_QSTRM;
conn->err_code = CO_ER_QMUX;
conn->flags |= CO_FL_ERROR;
return 0;
}
@ -174,7 +174,7 @@ int conn_send_qstrm(struct connection *conn, struct xprt_qstrm_ctx *ctx, int fla
return 0;
fail:
conn->err_code = CO_ER_QSTRM;
conn->err_code = CO_ER_QMUX;
conn->flags |= CO_FL_ERROR;
return 0;
}
@ -185,8 +185,8 @@ struct task *xprt_qstrm_io_cb(struct task *t, void *context, unsigned int state)
struct connection *conn = ctx->conn;
int free = 0, ret;
if (conn->flags & CO_FL_QSTRM_SEND) {
if (!conn_send_qstrm(conn, ctx, CO_FL_QSTRM_SEND)) {
if (conn->flags & CO_FL_QMUX_SEND) {
if (!conn_send_qstrm(conn, ctx, CO_FL_QMUX_SEND)) {
if (!(conn->flags & CO_FL_ERROR)) {
ctx->ops_lower->subscribe(conn, ctx->ctx_lower,
SUB_RETRY_SEND, &ctx->wait_event);
@ -195,8 +195,8 @@ struct task *xprt_qstrm_io_cb(struct task *t, void *context, unsigned int state)
}
}
if (conn->flags & CO_FL_QSTRM_RECV) {
if (!conn_recv_qstrm(conn, ctx, CO_FL_QSTRM_RECV)) {
if (conn->flags & CO_FL_QMUX_RECV) {
if (!conn_recv_qstrm(conn, ctx, CO_FL_QMUX_RECV)) {
if (!(conn->flags & CO_FL_ERROR)) {
ctx->ops_lower->subscribe(conn, ctx->ctx_lower,
SUB_RETRY_RECV, &ctx->wait_event);
@ -207,7 +207,7 @@ struct task *xprt_qstrm_io_cb(struct task *t, void *context, unsigned int state)
out:
if ((conn->flags & CO_FL_ERROR) ||
!(conn->flags & (CO_FL_QSTRM_RECV|CO_FL_QSTRM_SEND))) {
!(conn->flags & (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND))) {
/* XPRT should be unsubscribed when transfer done or on error. */
BUG_ON(ctx->wait_event.events);
@ -327,7 +327,7 @@ static void xprt_qstrm_close(struct connection *conn, void *xprt_ctx)
if (ctx->ops_lower && ctx->ops_lower->close)
ctx->ops_lower->close(conn, ctx->ctx_lower);
conn->flags &= ~(CO_FL_QSTRM_RECV|CO_FL_QSTRM_SEND);
conn->flags &= ~(CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
BUG_ON(conn->xprt_ctx != ctx);
conn->xprt_ctx = ctx->ctx_lower;
@ -344,17 +344,17 @@ static int xprt_qstrm_get_alpn(const struct connection *conn, void *xprt_ctx,
return ctx->ops_lower->get_alpn(conn, ctx->ctx_lower, str, len);
}
struct xprt_ops xprt_qstrm = {
struct xprt_ops xprt_qmux = {
.add_xprt = xprt_qstrm_add_xprt,
.init = xprt_qstrm_init,
.start = xprt_qstrm_start,
.close = xprt_qstrm_close,
.get_alpn = xprt_qstrm_get_alpn,
.name = "qstrm",
.name = "qmux",
};
static void __xprt_qstrm_init(void)
{
xprt_register(XPRT_QSTRM, &xprt_qstrm);
xprt_register(XPRT_QMUX, &xprt_qmux);
}
INITCALL0(STG_REGISTER, __xprt_qstrm_init);