]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: httpclient: Don't limit data transfer to 1024 bytes
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 12 Jan 2022 13:46:03 +0000 (14:46 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 2 Feb 2022 15:19:19 +0000 (16:19 +0100)
For debug purpose, no more 1024 bytes were copied at a time. But there is no
reason to keep this limitation. Thus, it is removed.

This patch may be backported to 2.5.

src/hlua.c
src/http_client.c

index 8da64eed6750121e7b09b0f328d9b98ec7fea235..06d4ce0c39ac156c3903448cf3ac9883ea9d8d1b 100644 (file)
@@ -7175,7 +7175,7 @@ __LJMP static int hlua_httpclient_snd_yield(lua_State *L, int status, lua_KConte
        body_str = lua_tolstring(L, -1, &buf_len);
        lua_pop(L, 1);
 
-       to_send = MIN(buf_len - hlua_hc->sent, 1024);
+       to_send = buf_len - hlua_hc->sent;
 
        if ((hlua_hc->sent + to_send) >= buf_len)
                end = 1;
index d41d59a7b112f1765407e8ed4167f3c3f80ca39a..6645a494664a0726861bcb981328e7717dca6a9b 100644 (file)
@@ -353,7 +353,7 @@ int httpclient_res_xfer(struct httpclient *hc, struct buffer *dst)
 {
        int ret;
 
-       ret = b_force_xfer(dst, &hc->res.buf, MIN(1024, b_data(&hc->res.buf)));
+       ret = b_force_xfer(dst, &hc->res.buf, b_data(&hc->res.buf));
        /* call the client once we consumed all data */
        if (!b_data(&hc->res.buf)) {
                b_free(&hc->res.buf);