]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux_quic: remove superfluous b_size() before b_alloc()
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Apr 2026 08:40:05 +0000 (10:40 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Apr 2026 13:59:28 +0000 (15:59 +0200)
b_alloc() does nothing if a buffer is already allocated. As such, it is
not necessary to call b_size() as a check prior to it. Removes its usage
in qcc_qstrm_recv() so that the code is similar to other b_alloc()
usages.

src/mux_quic_qstrm.c

index b0cf6a92d2c291562360f4332e6e93d4bd17768b..68360cd090cb40b999c33e58bfd216d86cf84555 100644 (file)
@@ -113,11 +113,9 @@ int qcc_qstrm_recv(struct qcc *qcc)
        if (qcc->flags & QC_CF_ERR_CONN)
                return 0;
 
-       if (!b_size(buf)) {
-               if (!b_alloc(buf, DB_MUX_RX)) {
-                       TRACE_ERROR("rx qstrm buf alloc failure", QMUX_EV_QCC_RECV);
-                       goto err;
-               }
+       if (!b_alloc(buf, DB_MUX_RX)) {
+               TRACE_ERROR("rx qstrm buf alloc failure", QMUX_EV_QCC_RECV);
+               goto err;
        }
 
        do {