aboutsummaryrefslogtreecommitdiff
path: root/lib/hostares.c
diff options
context:
space:
mode:
authorGunter Knauf <gk@gknw.de>2009-09-11 02:33:04 +0000
committerGunter Knauf <gk@gknw.de>2009-09-11 02:33:04 +0000
commit4002fbe1f545d7d6c4ba2cb6c988f73d1b29d931 (patch)
tree5d926fb5df2713bc10a29b9e636ffe03256a9046 /lib/hostares.c
parent7ff4b4f2b5871900d27f5640f71c41858727fc77 (diff)
Joshua Kwan provided a patch to pass POLLERR / POLLHUP back to c-ares.
This fixes a loop problem with high CPU usage.
Diffstat (limited to 'lib/hostares.c')
-rw-r--r--lib/hostares.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/hostares.c b/lib/hostares.c
index 1412f13a6..efecd86bd 100644
--- a/lib/hostares.c
+++ b/lib/hostares.c
@@ -169,10 +169,14 @@ static int ares_waitperform(struct connectdata *conn, int timeout_ms)
else {
/* move through the descriptors and ask for processing on them */
for(i=0; i < num; i++)
+ /*
+ * Following the advice from:
+ * http://lists.danga.com/pipermail/memcached/2003-October/000336.html
+ */
ares_process_fd(data->state.areschannel,
- pfd[i].revents & (POLLRDNORM|POLLIN)?
+ pfd[i].revents & (POLLRDNORM|POLLIN|POLLERR|POLLHUP)?
pfd[i].fd:ARES_SOCKET_BAD,
- pfd[i].revents & (POLLWRNORM|POLLOUT)?
+ pfd[i].revents & (POLLWRNORM|POLLOUT|POLLERR)?
pfd[i].fd:ARES_SOCKET_BAD);
}
return nfds;