Commit d36a1b06 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add more paranoia to the poll waiter.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4484 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 83b7bf6e
...@@ -97,7 +97,7 @@ static const struct linger linger = { ...@@ -97,7 +97,7 @@ static const struct linger linger = {
static unsigned char need_sndtimeo, need_rcvtimeo, need_linger, need_test; static unsigned char need_sndtimeo, need_rcvtimeo, need_linger, need_test;
int vca_pipes[2]; int vca_pipes[2] = { -1, -1 };
static void static void
sock_test(int fd) sock_test(int fd)
...@@ -344,7 +344,6 @@ vca_return_session(struct sess *sp) ...@@ -344,7 +344,6 @@ vca_return_session(struct sess *sp)
vca_act->pass(sp); vca_act->pass(sp);
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static void static void
......
...@@ -122,9 +122,17 @@ vca_main(void *arg) ...@@ -122,9 +122,17 @@ vca_main(void *arg)
assert(hpoll < npoll); assert(hpoll < npoll);
while (hpoll > 0 && pollfd[hpoll].fd == -1) while (hpoll > 0 && pollfd[hpoll].fd == -1)
hpoll--; 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); v = poll(pollfd, hpoll + 1, 100);
assert(v >= 0); assert(v >= 0);
if (v && pollfd[vca_pipes[0]].revents) { 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--; v--;
i = read(vca_pipes[0], ss, sizeof ss); i = read(vca_pipes[0], ss, sizeof ss);
assert(i >= 0); assert(i >= 0);
......
...@@ -13,4 +13,8 @@ client c1 { ...@@ -13,4 +13,8 @@ client c1 {
txreq -url "/" txreq -url "/"
rxresp rxresp
expect resp.status == 200 expect resp.status == 200
delay .1
txreq -url "/"
rxresp
expect resp.status == 200
} -run } -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment