]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: hq-interop: skip zero-copy with large buffers
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 16 Nov 2026 14:15:29 +0000 (15:15 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 16 Nov 2026 16:45:49 +0000 (17:45 +0100)
Large buffers were introduced in 3.4. They may be used in channels while
muxes continue to rely on normal-sized objects. In this case, zero-copy
must be disabled when sending data.

Most muxes were adapted but the hq-interop layer was forgotten. This
patch fixes this by adding a similar check to the one already present in
HTTP/3.

This must be backported up to 3.4.

src/hq_interop.c

index c9faa8581ee988abbaa041892664bceb156c608e..f7918771e9d7053ebf81350c6382117f8069663b 100644 (file)
@@ -282,7 +282,7 @@ static size_t hq_interop_snd_buf(struct qcs *qcs, struct buffer *buf,
                                goto end;
                        }
 
-                       if (unlikely(fsize == count &&
+                       if (unlikely(fsize == count && b_size(res) == b_size(buf) &&
                                     !b_data(res) &&
                                     htx_nbblks(htx) == 1 && btype == HTX_BLK_DATA)) {
                                void *old_area = res->area;