From: Amaury Denoyelle Date: Mon, 11 May 2026 08:39:19 +0000 (+0200) Subject: MINOR: mux_quic: remove qstrm naming in QUIC MUX X-Git-Tag: v3.4-dev12~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96b72fd4618f4934aeaf0b0aa860ebdd10e272a7;p=thirdparty%2Fhaproxy.git MINOR: mux_quic: remove qstrm naming in QUIC MUX This is a follow-up on the QUIC MUX renaming process. The current patch replaces "qstrm" naming with "qmux" in QUIC MUX source file. Some members are impacted in qcc and qcs structures, as well as some internal functions used for QMux receive/send. Internal mux_ops is also rename to qmux_ops. This is not a breaking change as its externally visible name was already set to "qmux" originally. --- diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index 6a0bfe6cb..5be71cfbb 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -89,12 +89,12 @@ struct qcc { struct quic_pacer pacer; /* engine used to pace emission */ int paced_sent_ctr; /* counter for when emission is interrupted due to pacing */ }; - /* qstrm */ - struct buffer qstrm_buf; + /* qmux */ + struct buffer qmux_buf; }; } tx; struct { - struct buffer qstrm_buf; + struct buffer qmux_buf; uint64_t rlen; /* last record length read */ } rx; @@ -179,7 +179,7 @@ struct qcs { struct { union { struct qc_stream_desc *stream; /* quic */ - struct buffer qstrm_buf; /* qstrm */ + struct buffer qmux_buf; /* qmux */ }; struct quic_fctl fc; /* stream flow control applied on sending */ struct quic_frame *msd_frm; /* MAX_STREAM_DATA frame prepared */ diff --git a/include/haproxy/qcm_qmux.h b/include/haproxy/qcm_qmux.h index 350ffc771..2e50383d7 100644 --- a/include/haproxy/qcm_qmux.h +++ b/include/haproxy/qcm_qmux.h @@ -3,8 +3,8 @@ #include -int qcc_qstrm_recv(struct qcc *qcc); +int qcc_qmux_recv(struct qcc *qcc); -int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms); +int qcc_qmux_send_frames(struct qcc *qcc, struct list *frms); #endif /* _HAPROXY_QCM_QMUX_H */ diff --git a/src/mux_quic.c b/src/mux_quic.c index cf79dcca3..a34d86b93 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -117,7 +117,7 @@ static void qcs_free(struct qcs *qcs) qc_stream_desc_release(qcs->tx.stream, qcs->tx.fc.off_real, qcc); } else if (!conn_is_quic(qcc->conn)) { - b_free(&qcs->tx.qstrm_buf); + b_free(&qcs->tx.qmux_buf); } /* Free Rx buffer. */ @@ -224,7 +224,7 @@ static struct qcs *qcs_new(struct qcc *qcc, uint64_t id, enum qcs_type type) qc_stream_desc_sub_room(qcs->tx.stream, qcm_ctrl_room); } else { - qcs->tx.qstrm_buf = BUF_NULL; + qcs->tx.qmux_buf = BUF_NULL; } } @@ -610,13 +610,13 @@ void qcs_notify_send(struct qcs *qcs) const struct buffer *qcs_tx_buf_const(const struct qcs *qcs) { return conn_is_quic(qcs->qcc->conn) ? - qc_stream_buf_get(qcs->tx.stream) : &qcs->tx.qstrm_buf; + qc_stream_buf_get(qcs->tx.stream) : &qcs->tx.qmux_buf; } struct buffer *qcs_tx_buf(struct qcs *qcs) { return conn_is_quic(qcs->qcc->conn) ? - qc_stream_buf_get(qcs->tx.stream) : &qcs->tx.qstrm_buf; + qc_stream_buf_get(qcs->tx.stream) : &qcs->tx.qmux_buf; } /* Returns total number of bytes not already sent to quic-conn layer. */ @@ -2718,7 +2718,7 @@ static int qcc_send_frames(struct qcc *qcc, struct list *frms, int stream) } return conn_is_quic(qcc->conn) ? qcc_quic_send_frames(qcc, frms, stream) : - qcc_qstrm_send_frames(qcc, frms); + qcc_qmux_send_frames(qcc, frms); } /* Emit a RESET_STREAM on . @@ -3267,7 +3267,7 @@ static int qcc_io_recv(struct qcc *qcc) if (!conn_is_quic(qcc->conn)) { if (!(qcc->wait_event.events & SUB_RETRY_RECV)) - qcc_qstrm_recv(qcc); + qcc_qmux_recv(qcc); } while (!LIST_ISEMPTY(&qcc->recv_list)) { @@ -3587,8 +3587,8 @@ static void qcc_release(struct qcc *qcc) TRACE_PROTO("application layer released", QMUX_EV_QCC_END, conn); if (conn && !conn_is_quic(conn)) { - b_free(&qcc->rx.qstrm_buf); - b_free(&qcc->tx.qstrm_buf); + b_free(&qcc->rx.qmux_buf); + b_free(&qcc->tx.qmux_buf); offer_buffers(NULL, 2); } @@ -3908,13 +3908,13 @@ static int qcm_init(struct connection *conn, struct proxy *prx, } if (!conn_is_quic(conn)) { - qcc->tx.qstrm_buf = BUF_NULL; - qcc->rx.qstrm_buf = BUF_NULL; + qcc->tx.qmux_buf = BUF_NULL; + qcc->rx.qmux_buf = BUF_NULL; /* Rx buffer is transferred from xprt layer - necessary if too many data were read */ - qcc->rx.rlen = xprt_qstrm_xfer_rxbuf(conn->xprt_ctx, &qcc->rx.qstrm_buf); + qcc->rx.rlen = xprt_qstrm_xfer_rxbuf(conn->xprt_ctx, &qcc->rx.qmux_buf); /* Cannot have a non empty record with an empty buffer. */ - BUG_ON(qcc->rx.rlen && !b_data(&qcc->rx.qstrm_buf)); + BUG_ON(qcc->rx.rlen && !b_data(&qcc->rx.qmux_buf)); } if (conn_is_back(conn)) { @@ -3980,7 +3980,7 @@ static int qcm_init(struct connection *conn, struct proxy *prx, } else { /* Wakeup MUX immediately if data copied from XPRT layer. */ - if (unlikely(b_data(&qcc->rx.qstrm_buf))) + if (unlikely(b_data(&qcc->rx.qmux_buf))) tasklet_wakeup(qcc->wait_event.tasklet); } @@ -4788,7 +4788,7 @@ static struct mux_proto_list mux_proto_quic = INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_quic); -static const struct mux_ops qstrm_ops = { +static const struct mux_ops qmux_ops = { .init = qcm_init, .destroy = qcm_destroy, .detach = qcm_strm_detach, @@ -4812,7 +4812,7 @@ static const struct mux_ops qstrm_ops = { .name = "QMUX", }; -static struct mux_proto_list mux_proto_qstrm = - { .token = IST("qmux"), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_BOTH, .mux = &qstrm_ops }; +static struct mux_proto_list mux_proto_qmux = + { .token = IST("qmux"), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_BOTH, .mux = &qmux_ops }; -INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_qstrm); +INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_qmux); diff --git a/src/qcm_qmux.c b/src/qcm_qmux.c index b7ad83bb2..a183a1587 100644 --- a/src/qcm_qmux.c +++ b/src/qcm_qmux.c @@ -14,7 +14,7 @@ #include /* Returns true if type can be used for QMux protocol. */ -static int qstrm_is_frm_valid(const struct quic_frame *frm) +static int qmux_is_frm_valid(const struct quic_frame *frm) { return frm->type == QUIC_FT_PADDING || frm->type == QUIC_FT_RESET_STREAM || @@ -37,7 +37,7 @@ static int qstrm_is_frm_valid(const struct quic_frame *frm) * Returns the frame length on success. If frame is truncated, 0 is returned. * A negative error code is used for fatal failures. */ -static int qstrm_parse_frm(struct qcc *qcc, struct buffer *buf) +static int qmux_parse_frm(struct qcc *qcc, struct buffer *buf) { struct quic_frame frm; const unsigned char *pos, *old, *end; @@ -49,7 +49,7 @@ static int qstrm_parse_frm(struct qcc *qcc, struct buffer *buf) if (!ret) return 0; - if (!qstrm_is_frm_valid(&frm)) { + if (!qmux_is_frm_valid(&frm)) { /* TODO close connection with FRAME_ENCODING_ERROR */ b_reset(buf); return -1; @@ -100,10 +100,10 @@ static int qstrm_parse_frm(struct qcc *qcc, struct buffer *buf) * * Returns the total amount of read data or -1 on error. */ -int qcc_qstrm_recv(struct qcc *qcc) +int qcc_qmux_recv(struct qcc *qcc) { struct connection *conn = qcc->conn; - struct buffer *buf = &qcc->rx.qstrm_buf; + struct buffer *buf = &qcc->rx.qmux_buf; struct buffer buf_rec; int total = 0, dec = 1, frm_ret; size_t ret = 1; @@ -114,7 +114,7 @@ int qcc_qstrm_recv(struct qcc *qcc) return 0; if (!b_alloc(buf, DB_MUX_RX)) { - TRACE_ERROR("rx qstrm buf alloc failure", QMUX_EV_QCC_RECV); + TRACE_ERROR("rx qmux buf alloc failure", QMUX_EV_QCC_RECV); goto err; } @@ -170,7 +170,7 @@ int qcc_qstrm_recv(struct qcc *qcc) while (qcc->rx.rlen && b_data(buf) >= qcc->rx.rlen) { buf_rec = b_make(b_orig(buf), b_size(buf), b_head_ofs(buf), qcc->rx.rlen); - frm_ret = qstrm_parse_frm(qcc, &buf_rec); + frm_ret = qmux_parse_frm(qcc, &buf_rec); BUG_ON(frm_ret < 0); /* TODO handle fatal errors */ if (!frm_ret) { @@ -208,7 +208,7 @@ int qcc_qstrm_recv(struct qcc *qcc) } /* Updates a stream after a successful emission of data of length . */ -static void qstrm_ctrl_send(struct qcs *qcs, uint64_t data) +static void qmux_ctrl_send(struct qcs *qcs, uint64_t data) { struct qcc *qcc = qcs->qcc; struct quic_fctl *fc_conn = &qcc->tx.fc; @@ -234,7 +234,7 @@ static void qstrm_ctrl_send(struct qcs *qcs, uint64_t data) QMUX_EV_QCS_SEND, qcc->conn, qcs); } - b_del(&qcs->tx.qstrm_buf, data); + b_del(&qcs->tx.qmux_buf, data); /* Release buffer if everything sent and stream is waiting for room. */ if (!qcs_prep_bytes(qcs) && (qcs->flags & QC_SF_BLK_MROOM)) { qcs->flags &= ~QC_SF_BLK_MROOM; @@ -275,12 +275,12 @@ static void qstrm_ctrl_send(struct qcs *qcs, uint64_t data) * Returns 0 if all data are emitted or a positive value if sending should be * retried later. A negative error code is used for a fatal failure. */ -int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms) +int qcc_qmux_send_frames(struct qcc *qcc, struct list *frms) { struct connection *conn = qcc->conn; struct quic_frame *frm, *frm_old; struct quic_frame *split_frm, *next_frm; - struct buffer *buf = &qcc->tx.qstrm_buf; + struct buffer *buf = &qcc->tx.qmux_buf; unsigned char *pos, *old, *end; size_t sent; int ret, lensz, enc; @@ -288,7 +288,7 @@ int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms) TRACE_ENTER(QMUX_EV_QCC_SEND, qcc->conn); if (!b_alloc(buf, DB_MUX_TX)) { - TRACE_ERROR("tx qstrm buf alloc failure", QMUX_EV_QCC_SEND); + TRACE_ERROR("tx qmux buf alloc failure", QMUX_EV_QCC_SEND); goto out; } @@ -366,7 +366,7 @@ int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms) b_del(buf, sent); if (frm->type >= QUIC_FT_STREAM_8 && frm->type <= QUIC_FT_STREAM_F) - qstrm_ctrl_send(frm->stream.stream, frm->stream.len); + qmux_ctrl_send(frm->stream.stream, frm->stream.len); if (split_frm) { qc_frm_free(NULL, &split_frm);