When the CLI applet was refactord in the commit
20ec1de21 ("MAJOR: cli:
Refacor parsing and execution of pipelined commands"), a regression was
introduced. The applet shutdown was not longer handled when the applet was
waiting for the next command line. It is especially visible when a client
timeout occurred because the client connexion is no longer closed.
To fix the issue, the test on the SE_FL_SHW flag was reintroduced in
CLI_ST_PARSE_CMDLINE state, but only is there is no pending input data.
It is a 3.2-specific issue. No backport needed.
break;
}
else if (appctx->st0 == CLI_ST_PARSE_CMDLINE) {
- if (cli_parse_cmdline(appctx) == 0)
+ if (cli_parse_cmdline(appctx) == 0) {
+ /* Now we close the output if we're not in interactive
+ * mode and the request buffer is empty. This still
+ * allows pipelined requests to be sent in
+ * non-interactive mode.
+ */
+ if (se_fl_test(appctx->sedesc, SE_FL_SHW)) {
+ appctx->st0 = CLI_ST_END;
+ continue;
+ }
break;
+ }
}
else if (appctx->st0 == CLI_ST_PROCESS_CMDLINE) {
/* ensure we have some output room left in the event we