]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: http-ana: Swap L7 buffer with request buffer by hand
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Mar 2026 20:42:10 +0000 (21:42 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Mar 2026 06:48:02 +0000 (07:48 +0100)
commitef2a2925855a48cecc9632371bec6e105235b73c
tree064eee3722b00bac8158c3bc705a3cd64252ea06
parentba7dc46a92551f4ab70ea3e7fb1471d8811b5b98
BUG/MINOR: http-ana: Swap L7 buffer with request buffer by hand

When a L7 retry is performed, we should not rely on b_xfer() to swap the L7
buffer with the request buffer. When it is performed the request buffer is
not allocated. b_xfer() must not be called with an unallocated destination
buffer. The swap remains an optim. For instance, It is not performed on
buffers of different size. So the caller is responsible to provide an
allocated destination buffer with enough free space to transfer data.

However, when a L7 retry is performed, we cannot allocate a request buffer,
because we cannot yield. An error was reported, if we wait for a buffer, the
error will be handled by process_stream(). But we can swap the buffers by
hand. At this stage, we know there is no request buffer, so we can easily
swap it with the L7 buffer.

Note there is no real bug for now.

This patch could be backported to all stable versions.
src/http_ana.c