From e8775d51dfc3f8f02c0dbf0f9ef43c21a1c10c7f Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 11 Jun 2025 11:30:24 +0200 Subject: [PATCH] MINOR: mux-quic: define flag for backend side Mux connection is flagged with new QC_CF_IS_BACK if used on the backend side. For now the only change is during traces, to be able to differentiate frontend and backend usage. --- include/haproxy/mux_quic-t.h | 2 +- src/mux_quic.c | 2 +- src/qmux_trace.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index 068f14eef..4aaaf9b34 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -232,7 +232,7 @@ struct qcc_app_ops { #define QC_CF_ERRL 0x00000001 /* fatal error detected locally, connection should be closed soon */ #define QC_CF_ERRL_DONE 0x00000002 /* local error properly handled, connection can be released */ -/* unused 0x00000004 */ +#define QC_CF_IS_BACK 0x00000004 /* backend side */ #define QC_CF_CONN_FULL 0x00000008 /* no stream buffers available on connection */ /* unused 0x00000010 */ #define QC_CF_ERR_CONN 0x00000020 /* fatal error reported by transport layer */ diff --git a/src/mux_quic.c b/src/mux_quic.c index ae38867d4..2d2720d68 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -3417,7 +3417,7 @@ static int qmux_init(struct connection *conn, struct proxy *prx, _qcc_init(qcc); conn->ctx = qcc; qcc->nb_hreq = qcc->nb_sc = 0; - qcc->flags = 0; + qcc->flags = conn_is_back(conn) ? QC_CF_IS_BACK : 0; qcc->app_st = QCC_APP_ST_NULL; qcc->glitches = 0; qcc->err = quic_err_transport(QC_ERR_NO_ERROR); diff --git a/src/qmux_trace.c b/src/qmux_trace.c index 272564739..6e879bb69 100644 --- a/src/qmux_trace.c +++ b/src/qmux_trace.c @@ -145,7 +145,7 @@ void qmux_dump_qcc_info(struct buffer *msg, const struct qcc *qcc) { const struct quic_conn *qc = qcc->conn->handle.qc; - chunk_appendf(msg, " qcc=%p(F)", qcc); + chunk_appendf(msg, " qcc=%p(%c)", qcc, (qcc->flags & QC_CF_IS_BACK) ? 'B' : 'F'); if (qcc->conn->handle.qc) chunk_appendf(msg, " qc=%p", qcc->conn->handle.qc); chunk_appendf(msg, " .st=%s .sc=%llu .hreq=%llu .flg=0x%04x",