From: Christopher Faulet Date: Wed, 3 Jul 2019 09:39:30 +0000 (+0200) Subject: BUG/MINOR: hlua/htx: Respect the reserve when HTX data are sent X-Git-Tag: v2.1-dev1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9060fc02b50db59ea97abedc2fce81cbf4eebcfe;p=thirdparty%2Fhaproxy.git BUG/MINOR: hlua/htx: Respect the reserve when HTX data are sent The previous commit 7e145b3e2 ("BUG/MINOR: hlua: Don't use channel_htx_recv_max()") is buggy. The buffer's reserve must be respected. This patch must be backported to 2.0 and 1.9. --- diff --git a/src/hlua.c b/src/hlua.c index 592a0ab91a..af2400400b 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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 = htx_free_data_space(htx); + max = htx_get_max_blksz(htx, channel_htx_recv_max(res, htx)); if (!max) goto snd_yield;