r3825 - in trunk/varnish-cache/bin: varnishd varnishtest/tests

tfheen at projects.linpro.no tfheen at projects.linpro.no
Wed Feb 25 11:25:43 CET 2009


Author: tfheen
Date: 2009-02-25 11:25:43 +0100 (Wed, 25 Feb 2009)
New Revision: 3825

Modified:
   trunk/varnish-cache/bin/varnishd/cache_acceptor.c
   trunk/varnish-cache/bin/varnishtest/tests/b00008.vtc
Log:
Stop segfaulting when trying to set a nonexistant waiter

We failed to properly check for the end of the list of waiters.
Handle this correctly and add a test case

Fixes #428


Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2009-02-25 07:46:42 UTC (rev 3824)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2009-02-25 10:25:43 UTC (rev 3825)
@@ -368,7 +368,7 @@
 		vca_act = NULL;
 		return;
 	}
-	for (i = 0; vca_waiters[i]->name; i++) {
+	for (i = 0; vca_waiters[i]; i++) {
 		if (!strcmp(arg, vca_waiters[i]->name)) {
 			vca_act = vca_waiters[i];
 			return;

Modified: trunk/varnish-cache/bin/varnishtest/tests/b00008.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00008.vtc	2009-02-25 07:46:42 UTC (rev 3824)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00008.vtc	2009-02-25 10:25:43 UTC (rev 3825)
@@ -19,3 +19,7 @@
 varnish v1 -cliok "help"
 
 varnish v1 -cliok "stats"
+
+varnish v1 -cliok "param.set waiter default"
+
+varnish v1 -clierr 106 "param.set waiter HASH(0x8839c4c)"



More information about the varnish-commit mailing list