mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 07:07:04 +02:00
BUG/MEDIUM: http-client: Ask for more room when request data cannot be xferred
When the request payload cannot be xferred to the channel because its buffer is full, we must request for more room by calling sc_need_room(). It is important to be sure the httpclient applet will not be woken up in loop to push more data while it is not possible. It is only an issue with large POSTs, when the payload is streamed. This patch must be backported as far as 2.6. Note that on 2.6, sc_need_room() only takes one argument.
This commit is contained in:
parent
d9ca8f6b71
commit
e4a0d40c62
@ -595,6 +595,10 @@ void httpclient_applet_io_handler(struct appctx *appctx)
|
|||||||
size_t data = htx->data;
|
size_t data = htx->data;
|
||||||
|
|
||||||
ret = htx_xfer_blks(htx, hc_htx, htx_used_space(hc_htx), HTX_BLK_UNUSED);
|
ret = htx_xfer_blks(htx, hc_htx, htx_used_space(hc_htx), HTX_BLK_UNUSED);
|
||||||
|
if (!ret.ret) {
|
||||||
|
sc_need_room(sc, channel_htx_recv_max(req, htx) + 1);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
data = htx->data - data;
|
data = htx->data - data;
|
||||||
channel_add_input(req, data);
|
channel_add_input(req, data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user