[master] 6083540 Minor polish and a test-case to get out in the corners of param-tweaking

Poul-Henning Kamp phk at varnish-cache.org
Tue Nov 12 17:11:42 CET 2013


commit 60835401b77a9d7b0570c486d707602219edd9e2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Nov 12 16:11:20 2013 +0000

    Minor polish and a test-case to get out in the corners of param-tweaking

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index b2691d5..8f90bd2 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -330,14 +330,14 @@ MCF_ParamSet(struct cli *cli, const char *param, const char *val)
 		*heritage.param = mgt_param;
 
 	if (cli->result != CLIS_OK) {
-		VCLI_Out(cli, "(attempting to set param %s to %s)\n",
+		VCLI_Out(cli, "\n(attempting to set param %s to %s)",
 		    pp->name, val);
 	} else if (child_pid >= 0 && pp->flags & MUST_RESTART) {
-		VCLI_Out(cli, "Change will take effect"
-		    " when child is restarted");
+		VCLI_Out(cli,
+		    "\nChange will take effect when child is restarted");
 	} else if (pp->flags & MUST_RELOAD) {
-		VCLI_Out(cli, "Change will take effect"
-		    " when VCL script is reloaded");
+		VCLI_Out(cli,
+		    "\nChange will take effect when VCL script is reloaded");
 	}
 }
 
diff --git a/bin/varnishd/mgt/mgt_param_tweak.c b/bin/varnishd/mgt/mgt_param_tweak.c
index 7800db0..4b22bc3 100644
--- a/bin/varnishd/mgt/mgt_param_tweak.c
+++ b/bin/varnishd/mgt/mgt_param_tweak.c
@@ -93,12 +93,12 @@ tweak_generic_double(struct vsb *vsb, volatile double *dest,
 		}
 		if (min != NULL && u < minv) {
 			VSB_printf(vsb,
-			    "Timeout must be greater or equal to %s\n", min);
+			    "Must be greater or equal to %s\n", min);
 			return (-1);
 		}
 		if (max != NULL && u > maxv) {
 			VSB_printf(vsb,
-			    "Timeout must be less than or equal to %s\n", max);
+			    "Must be less than or equal to %s\n", max);
 			return (-1);
 		}
 		*dest = u;
diff --git a/bin/varnishtest/tests/b00042.vtc b/bin/varnishtest/tests/b00042.vtc
new file mode 100644
index 0000000..1a6f947
--- /dev/null
+++ b/bin/varnishtest/tests/b00042.vtc
@@ -0,0 +1,28 @@
+varnishtest "param edge cases"
+
+varnish v1 -vcl {backend foo {.host = "127.0.0.1";}} -start
+
+
+varnish v1 -clierr "106" "param.set default_ttl -1"
+varnish v1 -clierr "106" "param.set acceptor_sleep_max 20"
+varnish v1 -clierr "200" "param.set prefer_ipv6 off"
+varnish v1 -clierr "200" "param.set prefer_ipv6 no"
+varnish v1 -clierr "200" "param.set prefer_ipv6 disable"
+varnish v1 -clierr "200" "param.set prefer_ipv6 false"
+varnish v1 -clierr "200" "param.set prefer_ipv6 on"
+varnish v1 -clierr "200" "param.set prefer_ipv6 yes"
+varnish v1 -clierr "200" "param.set prefer_ipv6 enable"
+varnish v1 -clierr "200" "param.set prefer_ipv6 true"
+varnish v1 -clierr "106" "param.set prefer_ipv6 foobar"
+varnish v1 -clierr "106" "param.set http_max_hdr 0"
+varnish v1 -clierr "106" "param.set http_max_hdr 1000000"
+varnish v1 -clierr "106" "param.set workspace_thread 1b"
+varnish v1 -clierr "106" "param.set workspace_thread 1b"
+varnish v1 -clierr "106" "param.set workspace_thread 1x"
+varnish v1 -clierr "106" "param.set workspace_thread x"
+varnish v1 -clierr "106" "param.set user ///"
+varnish v1 -clierr "106" "param.set user ///"
+varnish v1 -clierr "106" {param.set listen_address ""}
+varnish v1 -clierr "106" {param.set listen_address ",,"}
+varnish v1 -clierr "106" {param.set listen_address "\""}
+varnish v1 -clierr "106" {param.set pool_sess "\""}



More information about the varnish-commit mailing list