r4484 - in trunk/varnish-cache/bin: varnishd varnishtest/tests
phk at projects.linpro.no
phk at projects.linpro.no
Mon Jan 25 20:00:24 CET 2010
Author: phk
Date: 2010-01-25 20:00:23 +0100 (Mon, 25 Jan 2010)
New Revision: 4484
Modified:
trunk/varnish-cache/bin/varnishd/cache_acceptor.c
trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c
trunk/varnish-cache/bin/varnishtest/tests/b00009.vtc
Log:
Add more paranoia to the poll waiter.
Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2010-01-25 14:51:32 UTC (rev 4483)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2010-01-25 19:00:23 UTC (rev 4484)
@@ -97,7 +97,7 @@
static unsigned char need_sndtimeo, need_rcvtimeo, need_linger, need_test;
-int vca_pipes[2];
+int vca_pipes[2] = { -1, -1 };
static void
sock_test(int fd)
@@ -344,7 +344,6 @@
vca_act->pass(sp);
}
-
/*--------------------------------------------------------------------*/
static void
Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c 2010-01-25 14:51:32 UTC (rev 4483)
+++ trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c 2010-01-25 19:00:23 UTC (rev 4484)
@@ -122,9 +122,17 @@
assert(hpoll < npoll);
while (hpoll > 0 && pollfd[hpoll].fd == -1)
hpoll--;
+ assert(vca_pipes[0] <= hpoll);
+ assert(pollfd[vca_pipes[0]].fd = vca_pipes[0]);
+ assert(pollfd[vca_pipes[1]].fd = -1);
v = poll(pollfd, hpoll + 1, 100);
assert(v >= 0);
if (v && pollfd[vca_pipes[0]].revents) {
+
+ if (pollfd[vca_pipes[0]].revents != POLLIN)
+ VSL(SLT_Debug, 0, "pipe.revents= 0x%x",
+ pollfd[vca_pipes[0]].revents);
+ assert(pollfd[vca_pipes[0]].revents == POLLIN);
v--;
i = read(vca_pipes[0], ss, sizeof ss);
assert(i >= 0);
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00009.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00009.vtc 2010-01-25 14:51:32 UTC (rev 4483)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00009.vtc 2010-01-25 19:00:23 UTC (rev 4484)
@@ -13,4 +13,8 @@
txreq -url "/"
rxresp
expect resp.status == 200
+ delay .1
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
} -run
More information about the varnish-commit
mailing list