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.
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;
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 */
#include <haproxy/mux_quic.h>
-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 */
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. */
qc_stream_desc_sub_room(qcs->tx.stream, qcm_ctrl_room);
}
else {
- qcs->tx.qstrm_buf = BUF_NULL;
+ qcs->tx.qmux_buf = BUF_NULL;
}
}
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. */
}
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 <qcs>.
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)) {
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);
}
}
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)) {
}
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);
}
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,
.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);
#include <haproxy/trace.h>
/* Returns true if <frm> 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 ||
* 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;
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;
*
* 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;
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;
}
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) {
}
/* Updates a <qcs> stream after a successful emission of data of length <data>. */
-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;
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;
* 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;
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;
}
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);