]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: hlua: Properly report EOS when http applet exits
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Jun 2026 05:57:51 +0000 (07:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Jun 2026 08:55:22 +0000 (10:55 +0200)
When the Lua HTTP applet was migrated to the new API to use its own buffers,
a regression was introduced. The EOS flag at the end of the response was no
longer set. While it is not an issue when the response length is known
(because of a content-length or a transfer-encoding header), it is an issue
for responses with an unkown payload size. For the stconn and the stream, in
that case, the EOS is used to detect the end of the response. Without this
info, the stream remains blocked.

To fix the issue, the EOS flag is now set as expected on the applet.

This patch should fix the issue #3422. It must be backport as far as 3.3.

src/hlua.c

index 0a90df6eba394324eb200d8b0728e84107ab1f48..c50fb20b1d0963a44c9006f65e6a996cf04d7cfa 100644 (file)
@@ -11078,6 +11078,7 @@ void hlua_applet_http_fct(struct appctx *ctx)
                res_htx->flags |= HTX_FL_EOM;
                htx_to_buf(res_htx, outbuf);
                applet_set_eoi(ctx);
+               applet_set_eos(ctx);
                http_ctx->flags |= APPLET_RSP_SENT;
        }