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

Make TCP connect handle EINTR correctly #116132

Merged
merged 1 commit into from
Oct 19, 2023
Merged

Commits on Oct 13, 2023

  1. Make TCP connect() handle EINTR correctly

    According to the POSIX standard, if connect() is interrupted by a
    signal that is caught while blocked waiting to establish a connection,
    connect() shall fail and set errno to EINTR, but the connection
    request shall not be aborted, and the connection shall be established
    asynchronously.
    
    If asynchronous connection was successfully established after EINTR
    and before the next connection attempt, OS returns EISCONN that was
    handled as an error before. This behavior is fixed now and we handle
    it as success.
    
    The problem affects MacOS users: Linux doesn't return EISCONN in this
    case, Windows connect() can not be interrupted without an old-fashoin
    WSACancelBlockingCall function that is not used in the library.
    So current solution gives connect() as OS specific implementation.
    darthunix committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    dfadd17 View commit details
    Browse the repository at this point in the history