]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: http-client: Only consume input buffer when hc one is empty
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 May 2026 12:03:56 +0000 (14:03 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 May 2026 14:08:43 +0000 (16:08 +0200)
commitb24260ec9449fca37d2507820bb11fe0fb25a3de
tree2a6d0a20f851b351ace1cefde7329db09601d408
parentde6a26e3c89da24dea2449f66e21d10a0d3a3131
BUG/MEDIUM: http-client: Only consume input buffer when hc one is empty

Since http-client applet uses its own buffers, it is possible to have data
stuck in the applet input buffer while the http-client response buffer is
full, preventing the applet to consume these data. If this happens on the
last part of the response payload, the upper stream can decide to shut the
applet. In this case, the applet using the http client will not be able to
retrieve these last data because they will never be move into the hc
response buffer.

The main reason for this bug is that, for now, the applets cannot survive
the upper stream unlike multiplexers. It could be a good improvement for the
3.5. However, some applets still uses the stream-connector and the upper
stream (peer and stat applets for instance). So it is not an easy task.

In the mean time, to fix the issue on stable branches, the http-client
applet now stops to consume data when the hc response buffer is not empty.
This way, the applet shut will be deferred. Data will be consumed when they
can be fully moved in the httpclient response buffer.

This patch should fix the issue #3366. It must be backported to 3.3.
src/http_client.c