]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: hq-interop: refix tx buffering
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 9 Dec 2021 09:07:23 +0000 (10:07 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 10 Dec 2021 14:14:58 +0000 (15:14 +0100)
Incorrect usage of the buffer API : b_room() replaces b_size() to ensure
that we have enough size for http data copy.

src/hq_interop.c

index 9d0d566353190c8fb38c0d9e8d198978e30e87b8..9af937f700690d3a41252bed9a5f89bde1db206d 100644 (file)
@@ -98,8 +98,8 @@ static size_t hq_interop_snd_buf(struct conn_stream *cs, struct buffer *buf,
                        if (fsize > count)
                                fsize = count;
 
-                       if (b_size(&outbuf) < fsize)
-                               fsize = b_size(&outbuf);
+                       if (b_room(&outbuf) < fsize)
+                               fsize = b_room(&outbuf);
 
                        if (!fsize) {
                                qcs->flags |= QC_SF_BLK_MROOM;