Commit 44d1d8e7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add "cli" to tell varnishd things


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@441 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 88c1f30c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment