From 087c5f041bb4940bbe0f0cce2a0237748bbd2e2b Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 25 May 2023 10:16:19 +0200 Subject: [PATCH] MINOR: mux-quic: remove nb_streams from qcc Remove nb_streams field from qcc. It was not used outside of a BUG_ON() statement to ensure we never have a negative count of streams. However this is already checked with other fields. This should be backported up to 2.7. --- include/haproxy/mux_quic-t.h | 4 ---- src/mux_quic.c | 10 ---------- 2 files changed, 14 deletions(-) diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index 657f94386..4fd99932e 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -41,10 +41,6 @@ struct qcc { uint64_t nb_hreq; /* number of in-progress http requests */ uint32_t flags; /* QC_CF_* */ - struct { - uint64_t nb_streams; /* Number of open streams */ - } strms[QCS_MAX_TYPES]; - /* flow-control fields set by us enforced on our side. */ struct { struct list frms; /* prepared frames related to flow-control */ diff --git a/src/mux_quic.c b/src/mux_quic.c index 047a6a636..b071cca8f 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -68,9 +68,6 @@ static void qcs_free(struct qcs *qcs) qc_free_ncbuf(qcs, &qcs->rx.ncbuf); b_free(&qcs->tx.buf); - BUG_ON(!qcc->strms[qcs_id_type(qcs->id)].nb_streams); - --qcc->strms[qcs_id_type(qcs->id)].nb_streams; - /* Remove qcs from qcc tree. */ eb64_delete(&qcs->by_id); @@ -110,8 +107,6 @@ static struct qcs *qcs_new(struct qcc *qcc, uint64_t id, enum qcs_type type) qcs->id = qcs->by_id.key = id; eb64_insert(&qcc->streams_by_id, &qcs->by_id); - qcc->strms[type].nb_streams++; - /* Allocate transport layer stream descriptor. Only needed for TX. */ if (!quic_stream_is_uni(id) || !quic_stream_is_remote(qcc, id)) { struct quic_conn *qc = qcc->conn->handle.qc; @@ -2525,11 +2520,6 @@ static int qc_init(struct connection *conn, struct proxy *prx, qcc->tx.sent_offsets = qcc->tx.offsets = 0; - qcc->strms[QCS_CLT_BIDI].nb_streams = 0; - qcc->strms[QCS_CLT_UNI].nb_streams = 0; - qcc->strms[QCS_SRV_BIDI].nb_streams = 0; - qcc->strms[QCS_SRV_UNI].nb_streams = 0; - LIST_INIT(&qcc->lfctl.frms); qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi; qcc->lfctl.ms_uni = lparams->initial_max_streams_uni;