forked from tokio-rs/mio
-
Notifications
You must be signed in to change notification settings - Fork 3
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
[pull] master from tokio-rs:master #1
Open
pull
wants to merge
647
commits into
mesalock-linux:master
Choose a base branch
from
tokio-rs:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Per the Linux manual: > EAGAIN For nonblocking UNIX domain sockets, the socket is > nonblocking, and the connection cannot be completed > immediately. Previously the code incorrectly assumed that the connection was now in progress, which is incorrect. If that were the case EINPROGRESS would/should be returned by the OS
This is a reflect of the Linux manual, which unfortunately doesn't specify how to determine when the connect call should be retried.
Removes the need for the Win32_NetworkManagement_IpHelper feature as AF_INET and AF_INET6 are now included in the Win32_Networking_WinSock feature.
FreeBSD 12 adds some new private fields to struct kevent, and it changes the type of "data" from intptr_t to i64. For now libc only binds the 11-compat ABI, but that will change some day. Adjust mio's structure definitions for compatibility with either ABI. This should work on all 32 and 64 bit platforms.
Signed-off-by: Richard Zak <[email protected]>
Signed-off-by: Tricster <[email protected]>
Signed-off-by: Richard Zak <[email protected]>
This mainly concerns WASM/WASI.
On WASM/WASI.
Using epoll_create() as a fallback. Fix #1473.
Not required, Make handles this for us.
Now allows the fallback on all platforms, if we doing one why not all? Also properly closes the file descriptor if the fcntl call fails.
Switched O_CLOEXEC and EPOLL_CLOEXEC around in the last commit.
Using the old method in src/sys/unix/selector/mod.rs we needed to define all the targets twice, now we just do it once and set the path to the correct selector implementation. Note that is only possible because we increased MSRV so that it supports the path attribute, when the code was originally written this was not a thing.
The old macro was a mess of not(any(targets...)), means that when porting to a new target you always used the stateless implementation even if you didn't know about it. This fixes gotcha that and moves the logic of what kind of IoSourceState to use to the selector implemtnation files, which means that we don't have to worry about it when porting to a new platform.
Initially I though this would give a nice error message saying that platform X wasn't supported. But due to the amount of other errors the error message is still not great. So, to make porting easier in the future, just remove this and we'll get a `fds` not defined error.
Means we can remove the cfg_io_source! macro usage as that is already done in the selector implementation file.
And make it not pub, but pub(crate). No functional changes.
Also makes the pub -> pub(crate) change. No functional changes.
Also here the change from pub to pub(crate) was made. No functional changes.
And rename it to WakerInternal where needed.
This is because we're going to use a similar list of cfg attributes to the list we use for selector, so it's beneficial to have them close together.
So we don't have to define it twice. Similar change as we made for the selector module.
To be used in the poll implementation.
Same as what we did for the selector. But for the waker it's a little more complicated due to the poll(2) implementation. That needs to wrap the Waker type to use it's internal waker, compared to kqueue and epoll which just reexport the Waker directly. This logical of what waker to use is now moved to the selector module. For kqueue and epoll it's a simple export, for poll it's a special type that call the internal waker. This special poll waker used to be the fdbased waker. All these changes (hopefully) add up to no changes at all. All the supported targets should continue to work with all configurations. However it should be easier to port to new targets without having to deal with the clusterfuck that was the old sys::unix::waker module.
Make that clear in the code.
Before passing it to SocketAddr::from_pathname. This was a problem for Tokio's test suite where uds_socket::listen_and_stream failed. We can't reproduce the problem with just Mio's type as Mio doesn't allow a UnixStream to bound to a local path before connecting it.
It seems the same behaviour we seen for pipe waker implementation is also true for eventfd. Work around this by resetting the waker before writing to it.
The Hermit build would fail if --no-default-features --features os-ext were passed as flags. This is because the cfg_io_source! macro assumed that IoSource was needed for os-ext, which is true for Unix due to the usage of the Unix pipe, but not true for Hermit (it doesn't support Unix pipes).
Use directly libc as platform interface.
Implement `From<OwnedFd>` and `Into<OwnedFd>` for types that implement `FromRawFd` and `IntoRawFd`. And on Windows, implement `From<OwnedSocket>`, `Into<OwnedSocket>`, and `AsSocket` for types that implement `FromRawSocket`, `IntoRawSocket`, and `AsRawSocket`.
Android provides SocketAddrExt at a different path than other Linuxes, so from_abstract_name needs to be imported differently. This mirrors the imports at the top of the file.
Signed-off-by: Alice Ryhl <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot]. Want to support this open source service? Please star it : )