From: William Lallemand Date: Tue, 2 Nov 2021 09:40:06 +0000 (+0100) Subject: BUG/MINOR: httpclient/lua: misplaced luaL_buffinit() X-Git-Tag: v2.5-dev12~9 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=d1187eb3e1727b6ccf21ec705d4a51b11afba5f5;p=haproxy-2.5.git BUG/MINOR: httpclient/lua: misplaced luaL_buffinit() Some luaL_buffinit() call was done before the push of the variable name, where it seems to work correctly with lua < 5.4.3, it brokes systematically on this version. This patch inverts the pushstring and the buffinit. --- diff --git a/src/hlua.c b/src/hlua.c index 435455b..e9d4391 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -7200,8 +7200,8 @@ rcv: /* we return a "res" object */ lua_newtable(L); - luaL_buffinit(L, &hlua_hc->b); lua_pushstring(L, "body"); + luaL_buffinit(L, &hlua_hc->b); MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_httpclient_rcv_yield, TICK_ETERNITY, 0));