From: William Lallemand Date: Wed, 6 Apr 2022 12:12:37 +0000 (+0200) Subject: BUG/MINOR: httpclient: end callback in applet release X-Git-Tag: v2.6-dev5~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb0d4c40ac0a21944985a2d3ef6cf21cc05b87a8;p=thirdparty%2Fhaproxy.git BUG/MINOR: httpclient: end callback in applet release In case an error provokes the release of the applet, we will never call the end callback of the httpclient. In the case of a lua script, it would mean that the lua task will never be waked up after a yield, letting the lua script stuck forever. Fix the issue by moving the callback from the end of the iohandler to the applet release function. Must be backported in 2.5. --- diff --git a/src/http_client.c b/src/http_client.c index f06be65941..e8d7b05c54 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -946,8 +946,6 @@ more: return; end: - if (hc->ops.res_end) - hc->ops.res_end(hc); si_shutw(si); si_shutr(si); return; @@ -963,6 +961,8 @@ static void httpclient_applet_release(struct appctx *appctx) * again from the caller */ hc->appctx = NULL; + if (hc->ops.res_end) + hc->ops.res_end(hc); /* destroy the httpclient when set to autotokill */ if (hc->flags & HTTPCLIENT_FA_AUTOKILL) {