r619 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Aug 3 12:37:01 CEST 2006


Author: phk
Date: 2006-08-03 12:37:01 +0200 (Thu, 03 Aug 2006)
New Revision: 619

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_cli.c
Log:
Add stop command as well.


Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_cli.c	2006-08-03 10:16:20 UTC (rev 618)
+++ trunk/varnish-cache/bin/varnishd/mgt_cli.c	2006-08-03 10:37:01 UTC (rev 619)
@@ -24,21 +24,25 @@
 /*--------------------------------------------------------------------*/
 
 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 },




More information about the varnish-commit mailing list