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>
Wed, 1 Oct 2025 14:44:10 +0000 (16:44 +0200)
commitd9f70cbcf6692651dc6f41d11962e22f1a546ce5
tree1a293e2189f94c1d248a7afbccf0587d21927a47
parentf95f74caaa864f850616f137422a74dc226ebdbc
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>
(cherry picked from commit 03d4267efa7d815efd97366e9db5f9770f804370)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_client.c