-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
std:win: avoid WSA_FLAG_NO_INHERIT flag and don't use SetHandleInformation on UWP #66835
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR! I think it'd be best to keep the current structure though because it atomically creates a socket and sets the no-inherit flag. The current code looks like it already tries to handle the case that it fails and falls back to creating a socket and then setting the no-inherit flag. Does that fallback not seem to work for you? Is there a way we can tweak the fallback to work for you? |
@alexcrichton |
Can the list of error codes recognized to trigger the fallback get updated? |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the CALL file and clippy submodule update?
@bors: r+ Thanks! |
📌 Commit fa8b549 has been approved by |
⌛ Testing commit fa8b549 with merge 5f67d71525f973203cd93f8583e3867bb5fff4e1... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-azure |
@bors: retry |
std:win: avoid WSA_FLAG_NO_INHERIT flag and don't use SetHandleInformation on UWP This flag is not supported on Windows 7 before SP1, and on windows server 2008 SP2. This breaks Socket creation & duplication. This was fixed in a previous PR. cc #26658 This PR: cc #60260 reuses this flag to support UWP, and makes an attempt to handle the potential error. This version still fails to create a socket, as the error returned by WSA on this case is WSAEINVAL (invalid argument). and not WSAEPROTOTYPE. MSDN page for WSASocketW (that states the platform support for WSA_FLAG_NO_HANDLE_INHERIT): https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw CC #26543 CC #26518
☀️ Test successful - checks-azure |
This flag is not supported on Windows 7 before SP1, and on windows server 2008 SP2. This breaks Socket creation & duplication.
This was fixed in a previous PR. cc #26658
This PR: cc #60260 reuses this flag to support UWP, and makes an attempt to handle the potential error.
This version still fails to create a socket, as the error returned by WSA on this case is WSAEINVAL (invalid argument). and not WSAEPROTOTYPE.
MSDN page for WSASocketW (that states the platform support for WSA_FLAG_NO_HANDLE_INHERIT): https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw
CC #26543
CC #26518