]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: implements 'quit' in the CLI proxy
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 11 Dec 2018 15:10:55 +0000 (16:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Dec 2018 15:54:18 +0000 (16:54 +0100)
Implements the 'quit' command. Works the same way as the CLI command.

src/cli.c

index 3171c0a3c05e0d235a36c84b9256a5ea4f70fefe..c6d2265575d950015d29e9935ab44d80f9f75dab 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1787,6 +1787,11 @@ int pcli_find_and_exec_kw(struct stream *s, char **args, int argl, char **errmsg
        } else if (!strcmp("prompt", args[0])) {
                s->pcli_prompt ^= 1;
                return argl; /* return the number of elements in the array */
+
+       } else if (!strcmp("quit", args[0])) {
+               channel_shutr_now(&s->req);
+               channel_shutw_now(&s->res);
+               return argl; /* return the number of elements in the array */
        }
 
        return 0;