From 99e7f0b1b6d29a8dda6d49a5c4413b1c04faa753 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 3 Aug 2006 10:37:01 +0000 Subject: [PATCH] Add stop command as well. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@619 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/mgt_cli.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/varnish-cache/bin/varnishd/mgt_cli.c b/varnish-cache/bin/varnishd/mgt_cli.c index 4d36e0fd..41fc4e94 100644 --- a/varnish-cache/bin/varnishd/mgt_cli.c +++ b/varnish-cache/bin/varnishd/mgt_cli.c @@ -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 }, -- 2.39.5