-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
select: reduce duplication of Curl_poll in Curl_socket_check #5492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0c00145 to
cb70700
Compare
|
As you can see from the failing Windows CI builds, this seems to have made visible the root cause of some builds having issues with not timing out while connecting to a non-listening local port, eg. for the proxy tests. I will investigate this and hopefully come up with a fix which can be part of this PR. |
|
The problem I identified was that the poll-based socket check did not check the write socket for connection failure with POLLPRI. @bagder please take a look at the new commit. |
|
My plan is to create a separate PR for 5a2c961 this evening that also re-enables the currently disabled proxy connect tests on AppVeyor which have been disabled due to this issue. |
5a2c961 to
5c7131b
Compare
|
I still need to investigate the exact circumstances of the underlying issue in #5509 a little bit more first, therefore this PR is back to Draft state and put on hold, because the back and forth between poll and select is relevant for this. |
5c7131b to
307888d
Compare
The select-based socket check correctly checks for connect failures by adding the write socket also to fds_err. The poll-based implementation (which internally can itself fallback to select again) did not previously check for connect failure by using POLLPRI with the write socket. This commit makes sure connect failures can be detected and handled if HAVE_POLL_FINE is defined, eg. on msys2-devel. Therefore the related disabled tests can be enabled again. Related to curl#5492
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Closing this since it will be replaced by #5707. |
This commit changes Curl_socket_check to use POLLPRI to check for connect failure on the write socket, because POLLPRI maps to fds_err. This is in line with select(2). The select-based socket check correctly checks for connect failures by adding the write socket also to fds_err. The poll-based implementation (which internally can itself fallback to select again) did not previously check for connect failure by using POLLPRI with the write socket. See the follow up commit to this for more information. This commit makes sure connect failures can be detected and handled if HAVE_POLL_FINE is defined, eg. on msys2-devel. Replaces curl#5509 Related to curl#5492 Part of curl#5707
Change Curl_socket_check to use select-fallback in Curl_poll
instead of implementing it in Curl_socket_check and Curl_poll.
Replaces #5262