Skip to content
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

select: reduce duplication of Curl_poll in Curl_socket_check #5707

Closed
wants to merge 2 commits into from

Conversation

mback2k
Copy link
Member

@mback2k mback2k commented Jul 21, 2020

Change Curl_socket_check to use select-fallback in Curl_poll
instead of implementing it in Curl_socket_check and Curl_poll.

Replaces previous PRs #5492 and #5509 as one new PR.

@mback2k mback2k self-assigned this Jul 21, 2020
@mback2k mback2k changed the title Select dedup redux select: reduce duplication of Curl_poll in Curl_socket_check Jul 21, 2020
@mback2k mback2k requested a review from bagder July 21, 2020 21:11
@mback2k mback2k marked this pull request as ready for review July 22, 2020 01:33
@mback2k mback2k added the feature-window A merge of this requires an open feature window label Jul 28, 2020
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 curl#5262 and curl#5492
Follow up to curl#5509
Closes curl#5707
@mback2k
Copy link
Member Author

mback2k commented Aug 1, 2020

@bagder could you please take another look at this now in this new PR and rebased to current master? Thanks in advance!

lib/select.c Show resolved Hide resolved
@mback2k mback2k requested a review from jay August 2, 2020 15:35
mback2k added a commit that referenced this pull request Aug 25, 2020
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.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Replaces #5509
Prepares #5707
@mback2k mback2k closed this in 17f58c8 Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connecting & proxies feature-window A merge of this requires an open feature window tidy-up
Development

Successfully merging this pull request may close these issues.

None yet

3 participants