MINOR: mux-quic: use shorter name for flow-control fields
Rename the fields used for flow-control in the qcc structure. The
objective is to have shorter name for better readability while keeping
their purpose clear. It will be useful when the flow-control will be
extended with new fields.
diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h
index e7ae233..a5d4d2d 100644
--- a/include/haproxy/mux_quic-t.h
+++ b/include/haproxy/mux_quic-t.h
@@ -42,14 +42,14 @@
} tx;
} strms[QCS_MAX_TYPES];
- /* Flow-control related fields which are enforced on our side. */
+ /* flow-control fields set by us enforced on our side. */
struct {
- uint64_t max_bidi_streams; /* max sub-ID of bidi stream allowed for the peer */
- uint64_t initial_max_bidi_streams; /* max initial sub-ID of bidi stream allowed for the peer */
- uint64_t closed_bidi_streams; /* total count of closed bidi stream since last MAX_STREAMS emission */
+ uint64_t ms_bidi_init; /* max initial sub-ID of bidi stream allowed for the peer */
+ uint64_t ms_bidi; /* max sub-ID of bidi stream allowed for the peer */
+ uint64_t cl_bidi_r; /* total count of closed remote bidi stream since last MAX_STREAMS emission */
} lfctl;
- /* Flow-control related fields from the endpoint which we must respect. */
+ /* flow-control fields set by the peer which we must respect. */
struct {
} rfctl;
diff --git a/src/mux_quic.c b/src/mux_quic.c
index e5dddee..e239856 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -134,7 +134,7 @@
/* TODO also checks max-streams for uni streams */
if (quic_stream_is_bidi(id)) {
- if (sub_id + 1 > qcc->lfctl.max_bidi_streams) {
+ if (sub_id + 1 > qcc->lfctl.ms_bidi) {
/* streams limit reached */
goto out;
}
@@ -265,7 +265,7 @@
static int qc_is_max_streams_needed(struct qcc *qcc)
{
- return qcc->lfctl.closed_bidi_streams > qcc->lfctl.initial_max_bidi_streams / 2;
+ return qcc->lfctl.cl_bidi_r > qcc->lfctl.ms_bidi_init / 2;
}
/* detaches the QUIC stream from its QCC and releases it to the QCS pool. */
@@ -277,7 +277,7 @@
if (quic_stream_is_remote(qcs->qcc, id)) {
if (quic_stream_is_bidi(id)) {
- ++qcs->qcc->lfctl.closed_bidi_streams;
+ ++qcs->qcc->lfctl.cl_bidi_r;
if (qc_is_max_streams_needed(qcs->qcc))
tasklet_wakeup(qcs->qcc->wait_event.tasklet);
}
@@ -628,8 +628,8 @@
BUG_ON(!frm); /* TODO handle this properly */
frm->type = QUIC_FT_MAX_STREAMS_BIDI;
- frm->max_streams_bidi.max_streams = qcc->lfctl.max_bidi_streams +
- qcc->lfctl.closed_bidi_streams;
+ frm->max_streams_bidi.max_streams = qcc->lfctl.ms_bidi +
+ qcc->lfctl.cl_bidi_r;
fprintf(stderr, "SET MAX_STREAMS %lu\n", frm->max_streams_bidi.max_streams);
LIST_APPEND(&frms, &frm->list);
@@ -637,8 +637,8 @@
return 1;
/* save the new limit if the frame has been send. */
- qcc->lfctl.max_bidi_streams += qcc->lfctl.closed_bidi_streams;
- qcc->lfctl.closed_bidi_streams = 0;
+ qcc->lfctl.ms_bidi += qcc->lfctl.cl_bidi_r;
+ qcc->lfctl.cl_bidi_r = 0;
return 0;
}
@@ -749,8 +749,8 @@
qcc->strms[QCS_SRV_UNI].rx.max_data = lparams->initial_max_stream_data_uni;
qcc->strms[QCS_SRV_UNI].tx.max_data = 0;
- qcc->lfctl.max_bidi_streams = qcc->lfctl.initial_max_bidi_streams = lparams->initial_max_streams_bidi;
- qcc->lfctl.closed_bidi_streams = 0;
+ qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi;
+ qcc->lfctl.cl_bidi_r = 0;
qcc->wait_event.tasklet = tasklet_new();
if (!qcc->wait_event.tasklet)