]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: Don't use channel_htx_recv_max()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Jul 2019 19:29:43 +0000 (21:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Jul 2019 19:32:45 +0000 (21:32 +0200)
The function htx_free_data_space() must be used intead. Otherwise, if there are
some output data not already forwarded, the maximum amount of data that may be
inserted into the buffer may be greater than what we can really insert.

This patch must be backported to 2.0 and 1.9.

src/hlua.c

index 32f0e8db9314cf256149b658934bbf7d2cfd45b2..592a0ab91ac1d9fc011e7ce2deab139b8b2db56d 100644 (file)
@@ -4555,7 +4555,7 @@ __LJMP static int hlua_applet_htx_send_yield(lua_State *L, int status, lua_KCont
        int l = MAY_LJMP(luaL_checkinteger(L, 3));
        int max;
 
-       max = channel_htx_recv_max(res, htx);
+       max = htx_free_data_space(htx);
        if (!max)
                goto snd_yield;