]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Stop emptying the RX buffer asap.
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 20 Dec 2021 16:12:42 +0000 (17:12 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Mon, 20 Dec 2021 16:33:51 +0000 (17:33 +0100)
When a packet is present in the RX buffer at the first place
but without a null reference counter, there is no need to continue
to try to empty the buffer, it is sure the next packet will not
be at the first place!

include/haproxy/xprt_quic.h

index b731da27a52169087ca7dafdf40b7345b024ed96..13de0f196f8244b043c897033de333fb6ab36cee 100644 (file)
@@ -1083,11 +1083,12 @@ static inline void quic_rx_pkts_del(struct quic_conn *qc)
                        break;
                }
 
-               if (!HA_ATOMIC_LOAD(&pkt->refcnt)) {
-                       b_del(&qc->rx.buf, pkt->raw_len);
-                       LIST_DELETE(&pkt->qc_rx_pkt_list);
-                       pool_free(pool_head_quic_rx_packet, pkt);
-               }
+               if (HA_ATOMIC_LOAD(&pkt->refcnt))
+                       break;
+
+               b_del(&qc->rx.buf, pkt->raw_len);
+               LIST_DELETE(&pkt->qc_rx_pkt_list);
+               pool_free(pool_head_quic_rx_packet, pkt);
        }
 }