From 8b9173863c6c2f489bb1da35e04c65a611176ed8 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Wed, 2 Mar 2022 16:18:26 +0100 Subject: [PATCH] BUG/MEDIUM: httpclient/lua: infinite appctx loop with POST When POSTing a request with a payload, and reusing the same httpclient lua instance, one could encounter a spinning of the httpclient appctx. Indeed the sent counter is not reset between 2 POSTs and the condition for sending the EOM flag is never met. Must fixed issue #1593. To be backported in 2.5. (cherry picked from commit 10a37360c8c5dfc4a65aba81f67ae63fe5fa2161) [wla: context changes] Signed-off-by: William Lallemand --- src/hlua.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hlua.c b/src/hlua.c index 06d4ce0..87f417a 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -7256,6 +7256,8 @@ __LJMP static int hlua_httpclient_send(lua_State *L, enum http_meth_t meth) hlua_hc = hlua_checkhttpclient(L, 1); + hlua_hc->sent = 0; + hlua_hc->hc->req.url = istdup(ist(url_str)); hlua_hc->hc->req.meth = meth; -- 1.7.10.4