multi_wait: fix skipping to populate revents for extra_fds
On Windows revents was not populated for extra_fds if multi_wait had to wait due to the Curl_poll pre-check not signalling any readiness. This commit fixes that. Reviewed-by: Marcel Raad Reviewed-by: Jay Satiro Closes #9361
This commit is contained in:
parent
52484bf383
commit
a71fe41d2f
@ -1366,8 +1366,9 @@ static CURLMcode multi_wait(struct Curl_multi *multi,
|
|||||||
unsigned r = ufds[curlfds + i].revents;
|
unsigned r = ufds[curlfds + i].revents;
|
||||||
unsigned short mask = 0;
|
unsigned short mask = 0;
|
||||||
#ifdef USE_WINSOCK
|
#ifdef USE_WINSOCK
|
||||||
|
curl_socket_t s = extra_fds[i].fd;
|
||||||
wsa_events.lNetworkEvents = 0;
|
wsa_events.lNetworkEvents = 0;
|
||||||
if(WSAEnumNetworkEvents(extra_fds[i].fd, NULL, &wsa_events) == 0) {
|
if(WSAEnumNetworkEvents(s, NULL, &wsa_events) == 0) {
|
||||||
if(wsa_events.lNetworkEvents & (FD_READ|FD_ACCEPT|FD_CLOSE))
|
if(wsa_events.lNetworkEvents & (FD_READ|FD_ACCEPT|FD_CLOSE))
|
||||||
mask |= CURL_WAIT_POLLIN;
|
mask |= CURL_WAIT_POLLIN;
|
||||||
if(wsa_events.lNetworkEvents & (FD_WRITE|FD_CONNECT|FD_CLOSE))
|
if(wsa_events.lNetworkEvents & (FD_WRITE|FD_CONNECT|FD_CLOSE))
|
||||||
@ -1377,9 +1378,11 @@ static CURLMcode multi_wait(struct Curl_multi *multi,
|
|||||||
if(ret && pollrc <= 0 && wsa_events.lNetworkEvents)
|
if(ret && pollrc <= 0 && wsa_events.lNetworkEvents)
|
||||||
retcode++;
|
retcode++;
|
||||||
}
|
}
|
||||||
WSAEventSelect(extra_fds[i].fd, multi->wsa_event, 0);
|
WSAEventSelect(s, multi->wsa_event, 0);
|
||||||
if(pollrc <= 0)
|
if(pollrc <= 0) {
|
||||||
|
extra_fds[i].revents = mask;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if(r & POLLIN)
|
if(r & POLLIN)
|
||||||
mask |= CURL_WAIT_POLLIN;
|
mask |= CURL_WAIT_POLLIN;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user