]> err.no Git - varnish/commitdiff
Add "cli" to tell varnishd things
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 11 Jul 2006 19:29:16 +0000 (19:29 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 11 Jul 2006 19:29:16 +0000 (19:29 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@441 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtester/varnishtester.c

index 7808bc81cc774198c6d489d63a309a487ee30bda..42fca56b2036963aee2915947c54160d4ed0cd12 100644 (file)
@@ -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);