]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: quic: remove unused rxbufs member in receiver
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 13 Oct 2022 08:11:36 +0000 (10:11 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 13 Oct 2022 09:05:41 +0000 (11:05 +0200)
rxbuf is the structure used to store QUIC datagrams and redispatch them
to the connection thread.

Each receiver manages a list of rxbuf. This was stored both as an array
and a mt_list. Currently, only mt_list is needed so removed <rxbufs>
member from receiver structure.

This should be backported up to 2.6.

include/haproxy/receiver-t.h
src/proto_quic.c

index 5b16770aff74eed888d4a7c83258c585a74770b4..407c7be72e5687a4f19334ea6a10f58dc6993406 100644 (file)
@@ -65,7 +65,6 @@ struct receiver {
        struct rx_settings *settings;    /* points to the settings used by this receiver */
        struct list proto_list;          /* list in the protocol header */
 #ifdef USE_QUIC
-       struct rxbuf **rxbufs;           /* Array of buffers for RX (one by thread) */
        struct mt_list rxbuf_list;       /* The same as ->rxbufs but arranged in a list */
 #endif
        /* warning: this struct is huge, keep it at the bottom */
index cf1e0ded108061227b8ed3b412230a28c61ace0a..63d635d94bffa53e92a5b45de08270e64ebfc71a 100644 (file)
@@ -540,10 +540,6 @@ static int quic_alloc_rxbufs_listener(struct listener *l)
        int i;
        struct rxbuf *rxbuf;
 
-       l->rx.rxbufs = calloc(global.nbthread, sizeof *l->rx.rxbufs);
-       if (!l->rx.rxbufs)
-               return 0;
-
        MT_LIST_INIT(&l->rx.rxbuf_list);
        for (i = 0; i < global.nbthread; i++) {
                char *buf;
@@ -559,8 +555,6 @@ static int quic_alloc_rxbufs_listener(struct listener *l)
                        goto err;
                }
 
-               l->rx.rxbufs[i] = rxbuf;
-
                rxbuf->buf = b_make(buf, QUIC_RX_BUFSZ, 0, 0);
                LIST_INIT(&rxbuf->dgrams);
                MT_LIST_APPEND(&l->rx.rxbuf_list, &rxbuf->mt_list);
@@ -573,7 +567,6 @@ static int quic_alloc_rxbufs_listener(struct listener *l)
                pool_free(pool_head_quic_rxbuf, rxbuf->buf.area);
                free(rxbuf);
        }
-       free(l->rx.rxbufs);
        return 0;
 }