r2548 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Mar 4 09:54:53 CET 2008


Author: phk
Date: 2008-03-04 09:54:53 +0100 (Tue, 04 Mar 2008)
New Revision: 2548

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_param.c
Log:
Polish CLI output


Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c	2008-03-03 17:03:53 UTC (rev 2547)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c	2008-03-04 08:54:53 UTC (rev 2548)
@@ -159,12 +159,12 @@
 		else
 			u = strtoul(arg, NULL, 0);
 		if (u < min) {
-			cli_out(cli, "Must be at least %u", min);
+			cli_out(cli, "Must be at least %u\n", min);
 			cli_result(cli, CLIS_PARAM);
 			return;
 		}
 		if (u > max) {
-			cli_out(cli, "Must be no more than %u", max);
+			cli_out(cli, "Must be no more than %u\n", max);
 			cli_result(cli, CLIS_PARAM);
 			return;
 		}
@@ -747,12 +747,14 @@
 	for (pp = parspec; pp->name != NULL; pp++) {
 		if (!strcmp(pp->name, param)) {
 			pp->func(cli, pp, val);
-			if (pp->flags & MUST_RESTART)
-				cli_out(cli, "change will take effect"
+			if (cli->result != CLIS_OK) {
+			} else if (child_pid >= 0 && pp->flags & MUST_RESTART) {
+				cli_out(cli, "Change will take effect"
 				    " when child is restarted");
-			if (pp->flags & MUST_RELOAD)
-				cli_out(cli, "change will take effect"
+			} else if (pp->flags & MUST_RELOAD) {
+				cli_out(cli, "Change will take effect"
 				    " when VCL script is reloaded");
+			}
 			MCF_ParamSync();
 			return;
 		}




More information about the varnish-commit mailing list