]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http_client: Don't add input data on an empty request buffer
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 7 Apr 2022 08:47:07 +0000 (10:47 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 7 Apr 2022 09:04:39 +0000 (11:04 +0200)
commitdca3b5b2c6618860b305b48b5c55abe2877be832
tree4a12d7d7af34b6bd7196c76021e2e6954464f089
parent2eb5243e7fcd49369a0702ce49992fc534e70c53
BUG/MINOR: http_client: Don't add input data on an empty request buffer

When compiled in debug mode, a BUG_ON triggers an error when the payload is
fully transfered from the http-client buffer to the request channel
buffer. In fact, when channel_add_input() is called, the request buffer is
empty. So an error is reported when those data are directly forwarded,
because we try to add some output data on a buffer with no data.

To fix the bug, we must be sure to call channel_add_input() after the data
transfer.

The bug was introduced by the commit ccc7ee45f ("MINOR: httpclient: enable
request buffering"). So, this patch must be backported if the above commit
is backported.
src/http_client.c