]> err.no Git - varnish/commitdiff
Add stop command as well.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 3 Aug 2006 10:37:01 +0000 (10:37 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 3 Aug 2006 10:37:01 +0000 (10:37 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@619 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/mgt_cli.c

index 4d36e0fdb73d48257745e3f2233ea788a91571d4..41fc4e94af0e10dfed8e35a088f6051ce05777a3 100644 (file)
@@ -24,21 +24,25 @@ static int          cli_i = -1, cli_o = -1;
 /*--------------------------------------------------------------------*/
 
 static void
-mcf_server_start(struct cli *cli)
+mcf_server_startstop(struct cli *cli, char **av, void *priv)
 {
 
        (void)cli;
-       mgt_start_child();
+       (void)av;
+       if (priv != NULL)
+               mgt_stop_child();
+       else
+               mgt_start_child();
 }
 
-
 /*--------------------------------------------------------------------*/
 
 static struct cli_proto *cli_proto;
 
 static struct cli_proto mgt_cli_proto[] = {
        { CLI_HELP,             cli_func_help, NULL },  /* must be first */
-       { CLI_SERVER_START,     mcf_server_start, NULL },
+       { CLI_SERVER_START,     mcf_server_startstop, NULL },
+       { CLI_SERVER_STOP,      mcf_server_startstop, &cli_proto },
        { CLI_CONFIG_LOAD },
 #if 0
        { CLI_CONFIG_LOAD,      m_cli_func_config_load, NULL },