]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: applet: Always expect data when CLI is waiting for a new command
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 6 Sep 2023 07:17:33 +0000 (09:17 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 6 Sep 2023 07:36:19 +0000 (09:36 +0200)
There is a mechanism for applets to disable the read timeout on the opposite
side if it is now waiting for any data. Of course, there is also a way to
re-activate it. But, it must excplicitly be handle by applets.

For the CLI, some commands may state no input data are expected. So we must
be sure to reset its state when the applet is waiting for a new command. For
now, it is not a bug because no CLI command uses this mechanism.

This patch must be backported to 2.8.

src/cli.c

index 7d6f6675e31f4b9f55e2183ad20c605587bf2662..ec2fc91fb829a006044223fb94f09a56b4bb4924 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1168,6 +1168,7 @@ static void cli_io_handler(struct appctx *appctx)
                        applet_reset_svcctx(appctx);
                        appctx->st0 = CLI_ST_GETREQ;
                        applet_will_consume(appctx);
+                       applet_expect_data(appctx);
 
                        /* reactivate the \n at the end of the response for the next command */
                        appctx->st1 &= ~APPCTX_CLI_ST1_NOLF;