]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: remove dereferencement of connection when possible
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Jan 2022 15:50:58 +0000 (16:50 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 24 Jan 2022 09:30:49 +0000 (10:30 +0100)
Some functions of xprt-quic were still using connection instead of
quic_conn. This must be removed as the two are decorrelated : a
quic_conn can exist without a connection.

src/xprt_quic.c

index 7247cd5971bc135a350ce42ea3c9464888d22b5f..8e3b1dc21ef4ad4a97588cebc072d84625eaf419 100644 (file)
@@ -2752,7 +2752,7 @@ int qc_send_ppkts(struct qring *qr, struct ssl_sock_ctx *ctx)
                TRACE_PROTO("to send", QUIC_EV_CONN_SPPKTS, qc);
                for (pkt = first_pkt; pkt; pkt = pkt->next)
                        quic_tx_packet_refinc(pkt);
-               if (ctx->xprt->snd_buf(qc->conn, qc->conn->xprt_ctx,
+               if (ctx->xprt->snd_buf(qc->conn, qc->xprt_ctx,
                                       &tmpbuf, tmpbuf.data, 0) <= 0) {
                        for (pkt = first_pkt; pkt; pkt = pkt->next)
                                quic_tx_packet_refdec(pkt);
@@ -2807,7 +2807,7 @@ static int quic_build_post_handshake_frames(struct quic_conn *qc)
 
        for (i = 1; i < qc->tx.params.active_connection_id_limit; i++) {
                struct quic_connection_id *cid;
-               struct listener *l = __objt_listener(qc->conn->target);
+               struct listener *l = qc->li;
 
                frm = pool_alloc(pool_head_quic_frame);
                if (!frm)
@@ -3116,7 +3116,7 @@ int qc_treat_rx_pkts(struct quic_enc_level *cur_el, struct quic_enc_level *next_
 {
        struct eb64_node *node;
        int64_t largest_pn = -1;
-       struct quic_conn *qc = ctx->conn->qc;
+       struct quic_conn *qc = ctx->qc;
        struct quic_enc_level *qel = cur_el;
 
        TRACE_ENTER(QUIC_EV_CONN_ELRXPKTS, ctx->qc);
@@ -3444,7 +3444,7 @@ static void quic_conn_release(struct quic_conn *qc)
 void quic_close(struct connection *conn, void *xprt_ctx)
 {
        struct ssl_sock_ctx *conn_ctx = xprt_ctx;
-       struct quic_conn *qc = conn_ctx->conn->qc;
+       struct quic_conn *qc = conn_ctx->qc;
 
        TRACE_ENTER(QUIC_EV_CONN_CLOSE, qc);
        /* This task must be deleted by the connection-pinned thread. */