]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: hlua/cli: Fix lua CLI commands to work with applet's buffers
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Jul 2024 12:33:59 +0000 (14:33 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Jul 2024 08:05:40 +0000 (10:05 +0200)
commite5e36ce09722e63ca4542b0b2ff1a1eb905f8208
tree08c39c3b96c815beda3397136a7f591a1cfb75aa
parentba37ad41b26a6ba83581821c13426a7fbe4d2494
BUG/MEDIUM: hlua/cli: Fix lua CLI commands to work with applet's buffers

In 3.0, the CLI applet was rewritten to use its own buffers. However, the
lua part, used to register CLI commands at runtime, was not updated
accordingly. It means the lua CLI commands still try to write in the channel
buffers. This is of course totally unexepected and not supported. Because of
this bug, the applet hangs intead of returning the command result.

The registration of lua CLI commands relies on the lua TCP applets. So the
send and receive functions were fixed to use the applet's buffer when it is
required and still use the channel buffers otherwies. This way, other lua
TCP applets can still run on the legacy mode, without the applet's buffers.

This patch must be backported to 3.0.
src/hlua.c