]> git.kaiwu.me - haproxy.git/commit
MINOR: http-client: Add a function to notify some data were 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)
commit0d727e82c4805fcb3d43742a48901cd500c05aa1
tree81acdd5c942023a2a7924fcaed3e962f8b637ef5
parent37b48cb0923e4a5b413eac3fd52328acc6493d53
MINOR: http-client: Add a function to notify some data were consumed

Since commit b24260ec9 ("BUG/MEDIUM: http-client: Only consume input buffer
when hc one is empty"), the http-client applet stops to consume data as soon
as its response buffer is not empty. Only httpclient_res_xfer() is able to
unblock it.  However, some callers are directly accessing the httpclient
response buffer.  These ones have no way to notify the applet it can fill
the response buffer again.

httpclient_res_consumed() is added to do so and is now called from
httpclient_res_xfer(). In addition, the applet is no longer only woken up
when the response buffer is emptied, but as soon as some room was released.

Because the response buffer is no longer necessarily released when data are
consumed, the I/O handler must now rely on b_data() instead of b_is_null()
to decide to stop the reception. Otherwise, an emptied but still allocated
buffer would block the applet for good.

This patch is required to fix a bug and must be backported as far as 3.3
with the next commit.
include/haproxy/http_client.h
src/http_client.c