]> git.kaiwu.me - haproxy.git/commit
MINOR: http-client: Add an option to not stop the reception of the response
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Sep 2026 07:19:03 +0000 (09:19 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Sep 2026 14:50:30 +0000 (16:50 +0200)
commit230a395242eb9762e8586d545bf804cdac2905d8
treefe2101bf3811ffb433884494c7d03d25e9a4bb9d
parentf2f3f0792dbd6a1b146069b2ec1f6703e695004e
MINOR: http-client: Add an option to not stop the reception of the response

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. The applet is only unblocked when the
caller consumes these data by calling httpclient_res_xfer().

However, some callers are not consuming the response payload on the
fly. They are waiting for the end of the response to retrieve the whole
payload from the httpclient response buffer. For these callers,
httpclient_res_xfer() is never called. So the applet remains blocked and the
response is never fully received. The transfer is stuck till the server
timeout expiration.

To fix this, the HTTPCLIENT_O_RES_ACCUM option is added. It must be set by
the callers accumulating the whole response payload in the httpclient
response buffer. In that case, the applet must not stop the reception. Of
course, it means the whole payload must fit in the response buffer for these
callers. But it was already the case.

This patch depends on:

  * "BUG/MEDIUM: http-client: Don't use the httpclient context if it was released".

It is required to fix a bug and must be backported as far as 3.3 with the
next commits.
include/haproxy/http_client-t.h
src/http_client.c