]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Initialize pointers to TX ring buffer list
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 6 Jul 2021 14:25:08 +0000 (16:25 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
We initialize the pointer to the listener TX ring buffer list.
Note that this is not done for QUIC clients  as we do not fully support them:
we only have to allocate the list and attach it to server struct I guess.

include/haproxy/xprt_quic-t.h
src/xprt_quic.c

index 0e5671ed9051ab6b9ffb4d6e37df086070135ef8..850be40e74d06161b74b515ffcd577af0cb520c1 100644 (file)
@@ -635,6 +635,8 @@ struct quic_conn {
                int nb_pto_dgrams;
                /* Transport parameters sent by the peer */
                struct quic_transport_params params;
+               /* A pointer to a list of TX ring buffers */
+               struct mt_list *qring_list;
        } tx;
        struct {
                /* Number of received bytes. */
index 1fe3cc15130b02228119689642966b42f04ca2d0..1a458cd7c5298e37d9eb69571848dab7d1480be4 100644 (file)
@@ -2764,7 +2764,7 @@ static struct task *process_timer(struct task *task, void *ctx, unsigned int sta
  */
 static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
                                     unsigned char *dcid, size_t dcid_len,
-                                    unsigned char *scid, size_t scid_len, int server)
+                                    unsigned char *scid, size_t scid_len, int server, void *owner)
 {
        int i;
        struct quic_conn *qc;
@@ -2781,6 +2781,8 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
        qc->cids = EB_ROOT;
        /* QUIC Server (or listener). */
        if (server) {
+               struct listener *l = owner;
+
                qc->state = QUIC_HS_ST_SERVER_INITIAL;
                /* Copy the initial DCID. */
                qc->odcid.len = dcid_len;
@@ -2791,6 +2793,7 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
                if (scid_len)
                        memcpy(qc->dcid.data, scid, scid_len);
                qc->dcid.len = scid_len;
+               qc->tx.qring_list = &l->rx.tx_qrings;
        }
        /* QUIC Client (outgoing connection to servers) */
        else {
@@ -3292,7 +3295,7 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char **buf, const unsigned char *end,
                        pkt->odcid_len = dcid_len;
                        ipv4 = saddr->ss_family == AF_INET;
                        qc = qc_new_conn(pkt->version, ipv4, pkt->dcid.data, pkt->dcid.len,
-                                        pkt->scid.data, pkt->scid.len, 1);
+                                        pkt->scid.data, pkt->scid.len, 1, l);
                        if (qc == NULL)
                                goto err;
 
@@ -4353,7 +4356,7 @@ static int qc_conn_init(struct connection *conn, void **xprt_ctx)
 
                ipv4 = conn->dst->ss_family == AF_INET;
                qc = qc_new_conn(QUIC_PROTOCOL_VERSION_DRAFT_28, ipv4,
-                                dcid, sizeof dcid, NULL, 0, 0);
+                                dcid, sizeof dcid, NULL, 0, 0, srv);
                if (qc == NULL)
                        goto err;