]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: http-client/cli: Notify the http-client when the response is consumed
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Sep 2026 07:19:46 +0000 (09:19 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Sep 2026 14:50:30 +0000 (16:50 +0200)
In HTX mode, the "httpclient" CLI command does not use httpclient_res_xfer()
to consume the response. It dumps the HTX message stored in the http-client
response buffer and resets it by hand.

Thus, since commit b24260ec9 ("BUG/MEDIUM: http-client: Only consume input
buffer when hc one is empty"), the applet stops to consume data and is never
woken up again. The command is stuck just after the response headers, till
the server timeout expiration.

httpclient_res_consumed() is now called when the response buffer is reset.

This patch depends on :

  * MINOR: http-client: Add a function to notify some data were consumed

It must be backported as far as 3.3 with commit b24260ec9.

src/httpclient_cli.c

index c7b3166f5d82173b1f23aef92517eefe17cc28b0..7de4c891174df06c5efeb882081dddc2a25b6c69 100644 (file)
@@ -230,6 +230,7 @@ static int hc_cli_io_handler(struct appctx *appctx)
                        goto more;
                htx_reset(hc_htx);
                htx_to_buf(hc_htx, &hc->res.buf);
+               httpclient_res_consumed(hc);
 
        }