]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: quic: drop the intermediate packet tree pointer in the fast retransmissions
authorFrederic Lecaille <flecaille@haproxy.com>
Wed, 4 Nov 2026 17:00:02 +0000 (18:00 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 5 Nov 2026 08:58:36 +0000 (09:58 +0100)
In qc_prep_fast_retrans() and qc_prep_hdshk_fast_retrans(), the local
<pkts> pointer is assigned once and then only used once, as argument of
eb64_first(). Dereference the packet number space tree directly instead,
which removes five lines without changing the behaviour.

No functional change, no need to backport.

src/quic_retransmit.c

index 93d9ae614159bf011a78de457d2c44b189f83818..30ba6d60daf97507b66ce157ee6afa0c1a238f5d 100644 (file)
@@ -139,7 +139,6 @@ void qc_prep_fast_retrans(struct quic_conn *qc,
                           struct quic_pktns *pktns,
                           struct list *frms1, struct list *frms2)
 {
-       struct eb_root *pkts = &pktns->tx.pkts;
        struct list *frms = frms1;
        struct eb64_node *node;
        struct quic_tx_packet *pkt;
@@ -153,7 +152,7 @@ void qc_prep_fast_retrans(struct quic_conn *qc,
         * again into <frms2> so that a second probe datagram is sent.
         */
        pkt = NULL;
-       node = eb64_first(pkts);
+       node = eb64_first(&pktns->tx.pkts);
  start:
        while (node) {
                struct quic_tx_packet *p;
@@ -209,7 +208,6 @@ void qc_prep_hdshk_fast_retrans(struct quic_conn *qc,
 
        struct quic_enc_level *iqel = qc->iel;
        struct quic_enc_level *hqel = qc->hel;
-       struct eb_root *pkts;
        struct eb64_node *node;
        struct quic_tx_packet *pkt;
        struct list *tmp = &itmp;
@@ -217,8 +215,7 @@ void qc_prep_hdshk_fast_retrans(struct quic_conn *qc,
        TRACE_ENTER(QUIC_EV_CONN_SPPKTS, qc);
 
        pkt = NULL;
-       pkts = &iqel->pktns->tx.pkts;
-       node = eb64_first(pkts);
+       node = eb64_first(&iqel->pktns->tx.pkts);
        /* Skip the empty packet (they have already been retransmitted) */
        while (node) {
                struct quic_tx_packet *p;