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

curl_multi_poll always returns immediately if the wakeup socket has been disconnected #6132

Closed
tomalakgeretkal opened this issue Oct 26, 2020 · 0 comments

Comments

@tomalakgeretkal
Copy link

tomalakgeretkal commented Oct 26, 2020

curl_multi_poll delegates to Curl_multi_wait, which checks multi->wakeup_pair[0] for POLLIN activity then attempts to read from it.

Unfortunately, waking an iPad breaks the wakeup socket pair, triggering a POLLIN event and resulting in SOCKERRNO being set to ENOTCONN in Curl_multi_wait's final #ifdef ENABLE_WAKEUP block.

This condition, and other possible error conditions on the wakeup socket, are not handled, so the condition remains on the FD and curl_multi_poll will never block again.

Even if the iOS wake scenario is to be considered an edge case, it seems to me we'd be best off looking for and handling any wakeup socket errors anyway.

tomalakgeretkal added a commit to tomalakgeretkal/curl that referenced this issue Oct 26, 2020
@bagder bagder closed this as completed in 10818dc Nov 21, 2020
bagder pushed a commit that referenced this issue Aug 25, 2022
Sockets may be shut down by the kernel when the app is moved to the
background, but pipes are not.

Removed from KNOWN_BUGS

Fixes #6132
Closes #9368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants