]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: quic: remove a redundant test in the fast retransmission lookups
authorFrederic Lecaille <flecaille@haproxy.com>
Wed, 4 Nov 2026 16:34:40 +0000 (17:34 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 5 Nov 2026 08:58:36 +0000 (09:58 +0100)
qc_pkt_with_only_acked_frms() returns 1 for a packet without any frame,
since its loop is not entered and it falls back on the final return 1.
The LIST_ISEMPTY(&pkt->frms) test combined with it is therefore
redundant, both in qc_prep_fast_retrans() and in
qc_prep_hdshk_fast_retrans().

No functional change, no need to backport.

src/quic_retransmit.c

index a96767dc575c55e818c384ba7d573e8ae842f3b8..b9509527975a1a8cf26e7a6d5ad50fe8b213ab08 100644 (file)
@@ -167,7 +167,7 @@ void qc_prep_fast_retrans(struct quic_conn *qc,
                             "--> pn=%llu (%d %d %d)", (ull)p->pn_node.key,
                             LIST_ISEMPTY(&p->frms), !!(p->flags & QUIC_FL_TX_PACKET_COALESCED),
                             qc_pkt_with_only_acked_frms(p));
-               if (!LIST_ISEMPTY(&p->frms) && !qc_pkt_with_only_acked_frms(p)) {
+               if (!qc_pkt_with_only_acked_frms(p)) {
                        pkt = p;
                        break;
                }
@@ -228,7 +228,7 @@ void qc_prep_hdshk_fast_retrans(struct quic_conn *qc,
                TRACE_PRINTF(TRACE_LEVEL_PROTO, QUIC_EV_CONN_SPPKTS, qc, 0, 0, 0,
                             "--> pn=%llu (%d %d)", (ull)p->pn_node.key,
                             LIST_ISEMPTY(&p->frms), !!(p->flags & QUIC_FL_TX_PACKET_COALESCED));
-               if (!LIST_ISEMPTY(&p->frms) && !(p->flags & QUIC_FL_TX_PACKET_COALESCED) &&
+               if (!(p->flags & QUIC_FL_TX_PACKET_COALESCED) &&
                    !qc_pkt_with_only_acked_frms(p)) {
                        pkt = p;
                        break;