-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Description
I encountered this potential issue when trying to investigate a user report.
In the general case, Curl_poll will translate EINTR into a no-error return so that the caller may retry:
Lines 312 to 318 in a9f8fe2
| r = poll(ufds, nfds, pending_ms); | |
| if(r <= 0) { | |
| if((r == -1) && (SOCKERRNO == EINTR)) | |
| /* make EINTR from select or poll not a "lethal" error */ | |
| r = 0; | |
| return r; | |
| } |
However, if no valid fds are passed, Curl_poll delegates to Curl_wait_ms which doesn't try to eliminate EINTR errors:
Lines 94 to 104 in a9f8fe2
| r = poll(NULL, 0, (int)timeout_ms); | |
| #else | |
| { | |
| struct timeval pending_tv; | |
| r = select(0, NULL, NULL, NULL, curlx_mstotv(&pending_tv, timeout_ms)); | |
| } | |
| #endif /* HAVE_POLL_FINE */ | |
| #endif /* USE_WINSOCK */ | |
| if(r) | |
| r = -1; | |
| return r; |
Curl_poll is used from Curl_multi_wait where it's not obvious whether a non-zero number of file descriptors is always found.
This might be a red herring, but I suppose it wouldn't hurt fixing Curl_wait_ms (and/or Curl_poll) in any case.
Metadata
Metadata
Assignees
Labels
No labels