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 Jul 21, 2020
@mback2k mback2k marked this pull request as ready for review Jul 22, 2020
mback2k added 2 commits Aug 1, 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 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 Aug 2, 2020
bagder
bagder approved these changes Aug 3, 2020
jay
jay approved these changes Aug 24, 2020
mback2k added a commit that referenced this issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants