]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: Use a full prompt command for bidir connections with workers
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Apr 2025 12:54:55 +0000 (14:54 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Apr 2025 13:09:37 +0000 (15:09 +0200)
When a bidirection connection with no command is establisehd with a worker
(so "@@<pid>" alone), a "prompt" command is automatically added to display
the worker's prompt and enter in interactive mode in the worker context.
However, till now, an unfinished command line is sent, with a semicolon
instead of a newline at the end. It is not exactly a bug because this
works. But it is not really expected and could be a problem for future
changes.

So now, a full command line is sent: the "prompt" command finished by a
newline character.

src/cli.c

index 822de4e46b63a08211e917265f6f5089f915baf9..e3d0b6c7f3c8f7694b62062b087dc94d590cc672 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -2938,7 +2938,7 @@ int pcli_find_bidir_prefix(struct stream *s, struct channel *req, char **str, co
 
                /* without any command, simply enter the worker in interactive mode */
                if (!ret) {
-                       const char *cmd = "prompt;";
+                       const char *cmd = "prompt\n";
                        ci_insert(req, 0, cmd, strlen(cmd));
                        ret += strlen(cmd);
                }