BUG/MEDIUM: http-client: Don't wake http-client applet if nothing was xferred
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 8 Jul 2025 05:46:26 +0000 (07:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 Aug 2025 06:34:35 +0000 (08:34 +0200)
commit9dab53c6b7ba9928b61d68e5243930b1f72431f3
tree9e81f66a35e295eeb87f6b85c5fdbcf3469954a6
parent68c664f407bbc6d602f832344953e3c132da7217
BUG/MEDIUM: http-client: Don't wake http-client applet if nothing was xferred

When data are transferred to or from the htt-pclient, the applet is
systematically woken up, even when no data are transferred. This could lead
to needlessly wakeups. When called from a lua script, if data are blocked
for a while, this leads to a wakeup ping-pong loop where the http-client
applet is woken up by the lua script which wakes back the script.

To fix the issue, in httpclient_req_xfer() and httpclient_res_xfer()
functions, we now take care to not wake the http-client applet up when no
data are transferred.

This patch must be backported as far as 2.6.

(cherry picked from commit fffdac42df4848420028f89b14c2a90c12dbf9ab)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit b35b0aaf82d625c8f78f734fb5b4c0deebd1697a)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_client.c