]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cli: wait for payload data even without prompt
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 11 Dec 2018 15:10:56 +0000 (16:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Dec 2018 15:54:18 +0000 (16:54 +0100)
During a payload transfer, we need to wait for the data even when we are
not in interactive mode. Indeed, the data could be received line per
line progressively instead of in one recv.

Previously the CLI was doing a SHUTW just after the first line if it was
not in interactive mode. We now check if we are in payload mode to do
a SHUTW.

Should be backported in 1.8.

src/cli.c

index c6d2265575d950015d29e9935ab44d80f9f75dab..3af5c6ac862efbfedc74c19d83713dca849b7ee6 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -758,7 +758,8 @@ static void cli_io_handler(struct appctx *appctx)
                         * buffer is empty. This still allows pipelined requests
                         * to be sent in non-interactive mode.
                         */
-                       if ((res->flags & (CF_SHUTW|CF_SHUTW_NOW)) || (!(appctx->st1 & APPCTX_CLI_ST1_PROMPT) && !co_data(req))) {
+                       if (((res->flags & (CF_SHUTW|CF_SHUTW_NOW))) ||
+                          (!(appctx->st1 & APPCTX_CLI_ST1_PROMPT) && !co_data(req) && (!(appctx->st1 & APPCTX_CLI_ST1_PAYLOAD)))) {
                                appctx->st0 = CLI_ST_END;
                                continue;
                        }