BUG/MEDIUM: http-client: Test HTX_FL_EOM flag before commiting the HTX buffer
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 8 Jul 2025 06:24:45 +0000 (08:24 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 Aug 2025 06:51:46 +0000 (08:51 +0200)
commit03d4267efa7d815efd97366e9db5f9770f804370
treef7126aa15ee8aafa44ceac13bf06a7eab473fcbd
parent99dc78982db90181de548a9051e21069628ec6c5
BUG/MEDIUM: http-client: Test HTX_FL_EOM flag before commiting the HTX buffer

when htx_to_buf() function is called, if the HTX message is empty, the
buffer is reset. So HTX flags must not be tested after because the info may
be lost.

So now, we take care to test HTX_FL_EOM flag before calling htx_to_buf().

This patch must be backported as far as 2.8.

(cherry picked from commit 4bdb2e5a26587120101234c8f73cbc40d1777656)
[wla: API does not emit HTX in response for 3.2, some adjutements were
made to better match the 3.3 behavior]
Signed-off-by: William Lallemand <wlallemand@haproxy.com>
(cherry picked from commit d01fa873acdd5ac40819d311923a28159e01040b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_client.c