From: William Lallemand Date: Tue, 26 Apr 2022 09:46:13 +0000 (+0200) Subject: BUG/MINOR: httpclient/lua: error when the httpclient_start() fails X-Git-Tag: v2.6-dev8~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2d3db44ad4e8016646c4b83eb8ad837956644c8;p=thirdparty%2Fhaproxy.git BUG/MINOR: httpclient/lua: error when the httpclient_start() fails Jump to an luaL_error() when the httpclient fails, it could be the result of an allocation failure, or even a wrong URL. Must be backported in 2.5. --- diff --git a/src/hlua.c b/src/hlua.c index a2f5ca7b1b..3dd2667102 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -7300,7 +7300,8 @@ __LJMP static int hlua_httpclient_send(lua_State *L, enum http_meth_t meth) return 0; } - httpclient_start(hlua_hc->hc); + if (!httpclient_start(hlua_hc->hc)) + WILL_LJMP(luaL_error(L, "couldn't start the httpclient")); MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_httpclient_snd_yield, TICK_ETERNITY, 0));