]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: remove nb_streams from qcc
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 25 May 2023 08:16:19 +0000 (10:16 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 26 May 2023 15:17:00 +0000 (17:17 +0200)
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
src/mux_quic.c

index 657f943862dbbc7f9db753664fbe76dec4e796ee..4fd99932e26e1d8e36fbef18fbf57ac18ed49b33 100644 (file)
@@ -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  */
index 047a6a6362556c12afdfde011f775be426741741..b071cca8f421c75a7e509fb62905c789ce46dc8f 100644 (file)
@@ -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;