Index: lib/hostares.c =================================================================== RCS file: /cvsroot/curl/curl/lib/hostares.c,v retrieving revision 1.51 diff -u -r1.51 hostares.c --- lib/hostares.c 11 Sep 2009 02:33:06 -0000 1.51 +++ lib/hostares.c 12 Sep 2009 10:48:32 -0000 @@ -169,14 +169,10 @@ 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|POLLERR|POLLHUP)? + pfd[i].revents & (POLLRDNORM|POLLIN)? pfd[i].fd:ARES_SOCKET_BAD, - pfd[i].revents & (POLLWRNORM|POLLOUT|POLLERR)? + pfd[i].revents & (POLLWRNORM|POLLOUT)? pfd[i].fd:ARES_SOCKET_BAD); } return nfds; Index: lib/select.c =================================================================== RCS file: /cvsroot/curl/curl/lib/select.c,v retrieving revision 1.52 diff -u -r1.52 select.c --- lib/select.c 26 May 2008 15:09:28 -0000 1.52 +++ lib/select.c 12 Sep 2009 10:48:33 -0000 @@ -398,6 +398,20 @@ } } while(r == -1); + if(r < 0) + return -1; + if(r == 0) + return 0; + + for (i = 0; i < nfds; i++) { + if(ufds[i].fd == CURL_SOCKET_BAD) + continue; + if(ufds[i].revents & POLLHUP) + ufds[i].revents |= POLLIN; + if(ufds[i].revents & POLLERR) + ufds[i].revents |= (POLLIN|POLLOUT); + } + #else /* HAVE_POLL_FINE */ FD_ZERO(&fds_read);