From: phk Date: Tue, 11 Jul 2006 19:29:16 +0000 (+0000) Subject: Add "cli" to tell varnishd things X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90ae6401e6ced00367ed58b2bc0f8b2cd139cc77;p=varnish Add "cli" to tell varnishd things git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@441 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- 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);