From: Olivier Houchard Date: Thu, 19 Nov 2026 13:51:19 +0000 (+0100) Subject: BUG/MINOR: hlua: wait for the request in HTTP applets X-Git-Url: https://git.kaiwu.me/web/%22data:,/doc/static/gitweb.js?a=commitdiff_plain;h=d66af5638b0de95bf3667210cc9916b628f2d9f7;p=haproxy.git BUG/MINOR: hlua: wait for the request in HTTP applets Since the HTTP applet uses its own buffers, it only waits for the input buffer to be allocated before parsing the request, so it may run on an empty buffer and crash on BUG_ON() when it is woken up before the request was transferred, e.g. when the stream yields after the applet creation. Let's wait for some input data instead, as the other HTTP applets do. This was introduced by commit 48df877da ("MEDIUM: hlua: Update the http applet to use its own buffers") in 3.3-dev4, so it must be backported to 3.3. --- diff --git a/src/hlua.c b/src/hlua.c index 9ff1cbf57..1f227d354 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -11058,7 +11058,7 @@ void hlua_applet_http_fct(struct appctx *ctx) int app_idx = 1 - hlua->nargs; /* index of the HTTP applet object in the lua stask */ inbuf = applet_get_inbuf(ctx); - if (!inbuf) { + if (!inbuf || !applet_htx_input_data(ctx)) { applet_need_more_data(ctx); yield = 1; goto out;