]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Non-optimal use of a TX buffer
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 7 Jan 2022 13:32:31 +0000 (14:32 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 Jan 2022 16:58:26 +0000 (17:58 +0100)
When full, after having reset the writer index, let's reuse the TX buffer in
any case.

src/xprt_quic.c

index f1adc19a8e48bcbecc742f315c4b465d9b8dcaba..836e83f4c66757489a9e91a94b0b5f00ce3cbb01 100644 (file)
@@ -2450,9 +2450,9 @@ static int qc_prep_pkts(struct quic_conn *qc, struct qring *qr,
 
        TRACE_ENTER(QUIC_EV_CONN_PHPKTS, qc);
 
+       total = 0;
  start:
        dglen = 0;
-       total = 0;
        padding = 0;
        qel = &qc->els[tel];
        cbuf = qr->cbuf;
@@ -2603,10 +2603,8 @@ static int qc_prep_pkts(struct quic_conn *qc, struct qring *qr,
 
            if (rd && rd <= cbuf->wr) {
                        cb_wr_reset(cbuf);
-                       if (pos == spos) {
-                               /* Reuse the same buffer if nothing was built. */
-                               goto start;
-                       }
+                       /* Let's try to reuse this buffer */
+                       goto start;
                }
        }