]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: cli: Report inbuf is no longer full when a line is consumed
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Aug 2025 13:50:37 +0000 (15:50 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Aug 2025 14:01:50 +0000 (16:01 +0200)
When the command line parsing was refactored (20ec1de21 "MAJOR: cli: Refacor
parsing and execution of pipelined commands"), a regression was introduced.
When input data are consumed, information about the applet's input buffer
are no longer updated accordingly to state it is no longer full. So it is
possible to freeze the CLI applet. And a spinning loop may be encountered if
a client shutdown is detected in this state.

The fix is obivous. When data are consumed from the applet's input buffer,
APPCTX_FL_INBLK_FULL flag is removed to notify the input buffer is no longer
full and more data can be sent to the CLI applet.

This patch should fix the issue #3064. It must be backported to 3.2.

src/cli.c

index 09a356c00bddf588fc647eab51473e9e552d8883..027cab1e42944df4642bad02d3e5f1e0b7f9e9c4 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -974,6 +974,7 @@ int cli_parse_cmdline(struct appctx *appctx)
 
                b_del(&appctx->inbuf, len);
                b_add(appctx->cli_ctx.cmdline,  len);
+               applet_fl_clr(appctx, APPCTX_FL_INBLK_FULL);
 
                if (!(appctx->st1 & APPCTX_CLI_ST1_PAYLOAD)) {
                        char *last_arg;