]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: httpclient: Rework CLI I/O handler to handle full buffer cases
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Jun 2022 15:08:19 +0000 (17:08 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Jun 2022 15:20:57 +0000 (17:20 +0200)
commit0158bb23d75482f7827ff3bd0a73a6da90881ca5
treef9756dab21b94bd501d7433592fa5b0686e209d3
parent18de6f28809fc4228866e7717161692d54f31ce4
BUG/MEDIUM: httpclient: Rework CLI I/O handler to handle full buffer cases

'httpclient' command does not properly handle full buffer cases. When the
response buffer is full, we exit to retry later. However, the context flags
are updated. It means when this happens, we may loose a part of the
response.

So now, flags are preserved when we fail to push data into the response
buffer. In addition, instead of dumping one part per call, we now try to
dump as much data as possible.

Finally, when there is no more data, because everything was dumped or
because we are waiting for more data from the HTTP client, the applet is
updated accordingly by calling applet_have_no_more_data(). Otherwise, when
some data are blocked, applet_putchk() already takes care to update the SE
flags. So, it is useless to call sc_need_room().

This patch should fix the issue #1723. It must be backported as far as
2.5. But a massive refactoring was performed in 2.6. So, for the 2.5 and
below, the patch will have to be adapted.
src/http_client.c