r3966 - in branches/2.0/varnish-cache/bin: varnishd varnishtest/tests

tfheen at projects.linpro.no tfheen at projects.linpro.no
Fri Mar 20 12:03:50 CET 2009


Author: tfheen
Date: 2009-03-20 12:03:50 +0100 (Fri, 20 Mar 2009)
New Revision: 3966

Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_acceptor.c
   branches/2.0/varnish-cache/bin/varnishtest/tests/b00008.vtc
Log:
Merge r3825: 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

(adopt it for 2.0 where waiter is called acceptor)



Modified: branches/2.0/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_acceptor.c	2009-03-20 10:14:27 UTC (rev 3965)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_acceptor.c	2009-03-20 11:03:50 UTC (rev 3966)
@@ -368,7 +368,7 @@
 		vca_act = NULL;
 		return;
 	}
-	for (i = 0; vca_acceptors[i]->name; i++) {
+	for (i = 0; vca_acceptors[i]; i++) {
 		if (!strcmp(arg, vca_acceptors[i]->name)) {
 			vca_act = vca_acceptors[i];
 			return;

Modified: branches/2.0/varnish-cache/bin/varnishtest/tests/b00008.vtc
===================================================================
--- branches/2.0/varnish-cache/bin/varnishtest/tests/b00008.vtc	2009-03-20 10:14:27 UTC (rev 3965)
+++ branches/2.0/varnish-cache/bin/varnishtest/tests/b00008.vtc	2009-03-20 11:03:50 UTC (rev 3966)
@@ -19,3 +19,7 @@
 varnish v1 -cliok "help"
 
 varnish v1 -cliok "stats"
+
+varnish v1 -cliok "param.set acceptor default"
+
+varnish v1 -clierr 106 "param.set acceptor HASH(0x8839c4c)"



More information about the varnish-commit mailing list