From 90ae6401e6ced00367ed58b2bc0f8b2cd139cc77 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 11 Jul 2006 19:29:16 +0000 Subject: [PATCH] Add "cli" to tell varnishd things git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@441 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishtester/varnishtester.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/varnish-cache/bin/varnishtester/varnishtester.c b/varnish-cache/bin/varnishtester/varnishtester.c index 7808bc81..42fca56b 100644 --- a/varnish-cache/bin/varnishtester/varnishtester.c +++ b/varnish-cache/bin/varnishtester/varnishtester.c @@ -281,6 +281,20 @@ cmd_stop(char **av) /*--------------------------------------------------------------------*/ +static void +cmd_cli(char **av) +{ + + if (child == 0) { + fprintf(stderr, "No child running\n"); + exit (2); + } + write(pipe1[1], av[0], strlen(av[0])); + write(pipe1[1], "\n", 1); +} + +/*--------------------------------------------------------------------*/ + static void rd_cmd(struct bufferevent *bev, void *arg) { @@ -305,6 +319,8 @@ rd_cmd(struct bufferevent *bev, void *arg) cmd_stop(av + 2); else if (!strcmp(av[1], "serve")) cmd_serve(av + 2); + else if (!strcmp(av[1], "cli")) + cmd_cli(av + 2); else { fprintf(stderr, "Unknown command \"%s\"\n", av[1]); exit (2); -- 2.39.5