From 3ce43764be4c7b58481b4b7a7d9b77e2c02724cf Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 5 Dec 2006 13:37:05 +0000 Subject: Matt Witherspoon fixed a problem case when the CPU load went to 100% when a HTTP upload was disconnected: "What appears to be happening is that my system (Linux 2.6.17 and 2.6.13) is setting *only* POLLHUP on poll() when the conditions in my previous mail occur. As you can see, select.c:Curl_select() does not check for POLLHUP. So basically what was happening, is poll() was returning immediately (with POLLHUP set), but when Curl_select() looked at the bits, neither POLLERR or POLLOUT was set. This still caused Curl_readwrite() to be called, which quickly returned. Then the transfer() loop kept continuing at full speed forever." --- lib/select.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/select.c b/lib/select.c index b25067b6c..672e5b8cf 100644 --- a/lib/select.c +++ b/lib/select.c @@ -124,7 +124,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms) if (writefd != CURL_SOCKET_BAD) { if (pfd[num].revents & POLLOUT) ret |= CSELECT_OUT; - if (pfd[num].revents & POLLERR) + if (pfd[num].revents & (POLLERR|POLLHUP)) ret |= CSELECT_ERR; } -- cgit v1.2.3