Skip to content

Commit 535717f

Browse files
committed
Squashed commit of the following:
commit 5234b5f Author: Thomas de Zeeuw <[email protected]> Date: Sat Nov 13 12:57:29 2021 +0100 Release v0.8.0 commit 41a494b Author: Thomas de Zeeuw <[email protected]> Date: Sat Nov 13 12:59:43 2021 +0100 Fix Clippy warning commit a8c5756 Author: Thomas de Zeeuw <[email protected]> Date: Sun Nov 7 12:45:33 2021 +0100 Add changelog for v0.8 commit 7029a35 Author: Thomas de Zeeuw <[email protected]> Date: Sun Nov 7 12:34:33 2021 +0100 Add v0.7.14 change log From commit 064af84 commit dca2134 Author: Thomas de Zeeuw <[email protected]> Date: Sun Nov 7 11:26:23 2021 +0100 Fix feature flags for some tests files The test util module requires both the "os-poll" and "net" features. commit b9f089b Author: Thomas de Zeeuw <[email protected]> Date: Sun Nov 7 11:19:09 2021 +0100 Remove cfg attributes for Solaris We never really supported Solaris, we pretended it implemented epoll, but it never did see tokio-rs#1152. As no one ever committed to being a maintainer for the port I'm removing it now with this commit. Instead replace it with illumuos on the CI, which we do support (as it supports epoll) and for which we do have maintainers. commit 7d86108 Author: Thomas de Zeeuw <[email protected]> Date: Sun Nov 7 11:53:32 2021 +0100 Add section about raw fd to portability guidelines commit 3be5811 Author: Thomas de Zeeuw <[email protected]> Date: Sun Nov 7 12:09:53 2021 +0100 Add note about short receive on datagram sockets Talking about the differences between OSs. commit 3ca57f3 Author: Thomas de Zeeuw <[email protected]> Date: Sat Nov 6 15:20:54 2021 +0100 Document unconnected TcpStream returned by TcpStream::connect commit 47cf59c Author: Thomas de Zeeuw <[email protected]> Date: Sat Nov 6 15:04:56 2021 +0100 Deregister connection before dropping it in TCP example commit 05009e4 Author: Thomas de Zeeuw <[email protected]> Date: Sat Nov 6 14:53:45 2021 +0100 Document that Mio report OOB data in Event::is_readable Reporting Out-of-band (OOB) as readable it could leave applications open to DoS attacks. However because Mio uses edge-triggers most applications won't actually be effected. commit 44666e8 Author: Thomas de Zeeuw <[email protected]> Date: Sat Nov 6 14:41:54 2021 +0100 Fix match_like_matches_macro Clippy lint We've updated our MSVR since the comment above it. commit f8695a7 Author: Thomas de Zeeuw <[email protected]> Date: Sat Nov 6 14:39:42 2021 +0100 Update Rustc nightly version in CI commit f4b9252 Author: Ben Noordhuis <[email protected]> Date: Sun Oct 10 16:45:25 2021 +0200 Add sys::unix::SocketAddr::as_abstract_namespace() Fixes tokio-rs#1517. commit 04e0ca4 Author: Thomas de Zeeuw <[email protected]> Date: Tue Sep 28 18:16:01 2021 +0200 Update change log with v0.7.x releases Contains the work in the following commits: * v0.7.8 20b7298. * v0.7.9 07bc32f. * v0.7.10 b7006d7. * v0.7.11 772c692. * v0.7.12 7adfb75. * v0.7.13 75f41fb. commit e55ec59 Author: Thomas de Zeeuw <[email protected]> Date: Thu Oct 7 20:21:22 2021 +0200 Install nightly Rust on CI for install cargo-hack commit 499004f Author: Thomas de Zeeuw <[email protected]> Date: Thu Oct 7 20:14:36 2021 +0200 Install Cargo-hack using nightly on CI Cargo-hack's (transient) dependency bitflags has updated its MSRV. commit e9e91ff Author: Thomas de Zeeuw <[email protected]> Date: Tue Sep 28 19:59:15 2021 +0200 Fix Clippy warnings on Windows Seems this isn't check on the CI. commit b48cce6 Author: Thomas de Zeeuw <[email protected]> Date: Tue Sep 28 19:51:19 2021 +0200 Fix Clippy warnings commit 37aec3e Author: Thomas de Zeeuw <[email protected]> Date: Tue Sep 28 19:45:26 2021 +0200 Fix dead_code warnings for Windows commit 02e9be4 Author: Thomas de Zeeuw <[email protected]> Date: Tue Sep 28 19:32:35 2021 +0200 Remove TcpSocket type The socket2 crate provide all the functionality and more. Furthermore supporting all socket options is beyond the scope of Mio. The easier migration is to the socket2 crate, using the Socket or SockRef types. The migration for Tokio is tracked in tokio-rs/tokio#4135. commit d4ce420 Author: Rémi Lauzier <[email protected]> Date: Tue Jul 6 14:21:17 2021 -0400 Update dev-dependencies commit fbcc849 Author: Thomas de Zeeuw <[email protected]> Date: Sat Jul 3 12:44:57 2021 +0200 Change port in connect_error Hopefully this port is actually not used. Also check Event::is_write_closed since we expect that to be true. commit bfbcd9d Author: Jake Shadle <[email protected]> Date: Fri Jul 2 15:17:17 2021 +0200 Move wine from unsupported commit 21ddf94 Author: Ivan Enderlin <[email protected]> Date: Tue Jun 22 22:36:09 2021 +0200 chore: Make Clippy happy (bis). commit 6d62f5d Author: Ivan Enderlin <[email protected]> Date: Mon Jun 21 16:41:21 2021 +0200 chore: Make Clippy happy. commit 6eb1efa Author: Ivan Enderlin <[email protected]> Date: Mon Jun 21 16:22:16 2021 +0200 feat: Move `poll::selector` to `Registry::selector`. commit 441367b Author: Thomas de Zeeuw <[email protected]> Date: Sun Jun 13 00:33:17 2021 +0200 Fix Selector::try_clone Calls fcntl F_DUPFD_CLOEXEC expects two arguments; the command (F_DUPFD_CLOEXEC) and an argument for the command. In this case an lower bound for the resulting file descriptor. Because we didn't provide a value it would take whatever value was left in the register from whatever code used it before the system call. This caused Waker::new to fail, see issue tokio-rs#1497. commit cbcaedf Author: Thomas de Zeeuw <[email protected]> Date: Sat Jun 12 20:39:12 2021 +0200 Set FD_CLOEXEC flag on duplicated kqueue Poll Same as commit c52635c, but for kqueue. commit c52635c Author: Tim Zhang <[email protected]> Date: Tue May 25 11:40:54 2021 +0800 Set the close-on-exec flag for the duplicate epoll_fd The close-on-exec flag (FD_CLOEXEC; see fcntl(2)) for the duplicate descriptor created by dup(2) is off. We can use fcntl + F_DUPFD_CLOEXEC to dup the epoll_fd to fix this issue. Fixes: tokio-rs/tokio#3809 Signed-off-by: Tim Zhang <[email protected]> commit 2246ffb Author: Taiki Endo <[email protected]> Date: Sun May 23 16:06:15 2021 +0900 Use ubuntu-18.04 instead of ubuntu-16.04 commit 0cfba5d Author: cdcode <[email protected]> Date: Sun Jun 6 22:42:26 2021 +0100 Small spelling correction in example commit 22e8858 Author: Thomas de Zeeuw <[email protected]> Date: Thu May 13 17:09:57 2021 +0200 Update outdated comment commit 607a12f Author: Thomas de Zeeuw <[email protected]> Date: Mon May 10 12:10:28 2021 +0200 Replace x86_64-sun-solaris with x86_64-pc-solaris rust-lang/rust#82216 removed the x86_64-sun-solaris target from rustup, changing it to use x86_64-pc-solaris instead. Related issues: * rust-lang/rust#85098 commit 27a6a3c Author: Thomas de Zeeuw <[email protected]> Date: Mon May 10 11:56:41 2021 +0200 Avoid cast pointers to usize in windows::NamedPipe Changes the Inner::ptr_from_* methods to use ptr::wrapping_sub rather then casting to usize. commit e316b21 Author: Thomas de Zeeuw <[email protected]> Date: Wed May 5 12:13:47 2021 +0200 Replace offset constants with methods in Windows NamedPipe commit 9e13732 Author: Thomas de Zeeuw <[email protected]> Date: Mon Apr 12 20:26:53 2021 +0200 Reorder NamedPipe fields Moving the Overlapped fields to the start to make it easier to determine the offsets and hopefully incur less breakage once external fields change size. Note that the Overlapped fields internally uses miow::Overlapped, which in turn is a OVERLAPPED struct as found in the winapi crate and has a stable layout (as defined by the Windows API). commit db0d74c Author: Thomas de Zeeuw <[email protected]> Date: Mon Apr 12 20:03:24 2021 +0200 Remove unsound offset_of macro And replace it with constants that define the offsets to the fields. It's not a pretty solution, but it's one without UB. commit 1667a70 Author: Rob Ede <[email protected]> Date: Thu Apr 1 17:01:01 2021 +0100 remove manual doc versioning
1 parent 0729d7a commit 535717f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+841
-766
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Windows changes
2+
/src/sys/windows/ @carllerche

CHANGELOG.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
# 0.8.0
2+
3+
## Removed
4+
5+
* Deprecated features (https://github.com/tokio-rs/mio/commit/105f8f2afb57b01ddea716a0aa9720f226c520e3):
6+
* extra-docs (always enabled)
7+
* tcp (replaced with "net" feature).
8+
* udp (replaced with "net" feature).
9+
* uds (replaced with "net" feature).
10+
* pipe (replaced with "os-ext" feature).
11+
* `TcpSocket` type
12+
(https://github.com/tokio-rs/mio/commit/02e9be41f27daf822575444fdd2b3067433a5996).
13+
The socket2 crate provides all the functionality and more.
14+
* Support for Solaris, it never really worked anyway
15+
(https://github.com/tokio-rs/mio/pull/1528).
16+
17+
## Changes
18+
19+
* Update minimum Rustc version (MSVR) to 1.46.0
20+
(https://github.com/tokio-rs/mio/commit/5c577efecd23750a9a3e0f6ad080ab98f14a255d).
21+
22+
## Added
23+
24+
* `UdpSocket::peer_addr`
25+
(https://github.com/tokio-rs/mio/commit/5fc104d08e0e74c8a19247f7cba0f058699fc438).
26+
27+
# 0.7.14
28+
29+
## Fixes
30+
31+
* Remove use unsound internal macro (#1519).
32+
33+
## Added
34+
35+
* `sys::unix::SocketAddr::as_abstract_namespace()` (#1520).
36+
37+
# 0.7.13
38+
39+
## Fixes
40+
41+
* Fix `Registry::try_clone` invalid usage of `F_DUPFD_CLOEXEC` (#1497,
42+
https://github.com/tokio-rs/mio/commit/2883f5c1f35bf1a59682c5ffc4afe6b97d7d6e68).
43+
44+
# 0.7.12 (yanked)
45+
46+
## Fixes
47+
48+
* Set `FD_CLOEXEC` when calling `Registry::try_clone`
49+
(https://github.com/tokio-rs/mio/commit/d1617b567ff6bc669d71e367d22e0e93ff7e2e24 for epoll and
50+
(https://github.com/tokio-rs/mio/commit/b367a05e408ca90a26383c3aa16d8a16f019dc59 for kqueue).
51+
152
# 0.7.11
253

354
## Fixes
@@ -12,6 +63,8 @@
1263
* Fix an instance of not doc(cfg(.*))
1364
(https://github.com/tokio-rs/mio/commit/25e8f911357c740034f10a170dfa4ea1b28234ce).
1465

66+
# 0.7.9
67+
1568
## Fixes
1669

1770
* Fix error handling in `NamedPipe::write`
@@ -46,7 +99,6 @@
4699
themselves already
47100
(https://github.com/tokio-rs/mio/commit/1be481dcbbcb6906364008b5d61e7f53cddc3eb3).
48101

49-
50102
## Fixes
51103

52104
* Underflow in `SocketAddr::address`

Cargo.toml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22
edition = "2018"
33
name = "mio"
44
# When releasing to crates.io:
5-
# - Update html_root_url.
65
# - Update CHANGELOG.md.
7-
# - Update doc URL.
86
# - Create git tag
9-
version = "0.7.11"
7+
version = "0.8.0"
108
license = "MIT"
119
authors = [
1210
"Carl Lerche <[email protected]>",
1311
"Thomas de Zeeuw <[email protected]>",
1412
"Tokio Contributors <[email protected]>",
1513
]
1614
description = "Lightweight non-blocking IO"
17-
documentation = "https://docs.rs/mio/0.7.7"
1815
homepage = "https://github.com/tokio-rs/mio"
1916
repository = "https://github.com/tokio-rs/mio"
2017
readme = "README.md"
@@ -41,14 +38,6 @@ os-ext = ["os-poll"]
4138
# Enables `mio::net` module containing networking primitives.
4239
net = []
4340

44-
# Deprecated features, will be removed in a future version.
45-
extra-docs = [] # Docs are now always present.
46-
tcp = ["net"] # Replaced with "net" feature.
47-
udp = ["net"] # Replaced with "net" feature.
48-
uds = ["net"] # Replaced with "net" feature.
49-
pipe = ["os-ext"] # Replaced with "os-ext" feature.
50-
os-util = ["os-ext"]# Replaced with "os-ext" feature.
51-
5241
[dependencies]
5342
iovec = "0.1.2"
5443
net2 = "0.2.33"
@@ -63,8 +52,8 @@ winapi = { version = "0.3", features = ["winsock2", "mswsock", "mstcpip"] }
6352
ntapi = "0.3"
6453

6554
[dev-dependencies]
66-
env_logger = { version = "0.6.2", default-features = false }
67-
rand = "0.4"
55+
env_logger = { version = "0.8.4", default-features = false }
56+
rand = "0.8"
6857

6958
[package.metadata.docs.rs]
7059
all-features = true
@@ -74,15 +63,14 @@ targets = [
7463
"aarch64-linux-android",
7564
"x86_64-apple-darwin",
7665
"x86_64-pc-windows-msvc",
77-
"x86_64-sun-solaris",
7866
"x86_64-unknown-dragonfly",
7967
"x86_64-unknown-freebsd",
68+
"x86_64-unknown-illumos",
8069
"x86_64-unknown-linux-gnu",
8170
"x86_64-unknown-netbsd",
8271
"x86_64-unknown-openbsd",
8372
]
8473

85-
8674
[package.metadata.playground]
8775
features = ["os-poll", "os-ext", "net"]
8876

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Targets available via Rustup that are supported.
2-
TARGETS ?= "aarch64-apple-ios" "aarch64-linux-android" "x86_64-apple-darwin" "x86_64-pc-windows-msvc" "x86_64-sun-solaris" "x86_64-unknown-freebsd" "x86_64-unknown-linux-gnu" "x86_64-unknown-netbsd"
2+
TARGETS ?= "aarch64-apple-ios" "aarch64-linux-android" "x86_64-apple-darwin" "x86_64-pc-windows-msvc" "x86_64-unknown-freebsd" "x86_64-unknown-illumos" "x86_64-unknown-linux-gnu" "x86_64-unknown-netbsd"
33

44
test:
55
cargo test --all-features
66

77
# Test everything for the current OS/architecture and check all targets in
88
# $TARGETS.
99
test_all: check_all_targets
10-
cargo hack test --feature-powerset --skip guide,extra-docs,tcp,udp,uds,pipe,os-util
11-
cargo hack test --feature-powerset --skip guide,extra-docs,tcp,udp,uds,pipe,os-util --release
10+
cargo hack test --feature-powerset
11+
cargo hack test --feature-powerset --release
1212

1313
# Check all targets using all features.
1414
check_all_targets: $(TARGETS)
1515
$(TARGETS):
16-
cargo hack check --target $@ --feature-powerset --skip guide,extra-docs,tcp,udp,uds,pipe,os-util
16+
cargo hack check --target $@ --feature-powerset
1717

1818
# Installs all required targets for `check_all_targets`.
1919
install_targets:

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ or higher-level libraries.
129129

130130
Currently supported platforms:
131131

132-
* Android
132+
* Android (API level 21)
133133
* DragonFly BSD
134134
* FreeBSD
135135
* Linux
@@ -139,6 +139,7 @@ Currently supported platforms:
139139
* Windows
140140
* iOS
141141
* macOS
142+
* Wine (version 6.11+, see [issue #1444])
142143

143144
There are potentially others. If you find that Mio works on another
144145
platform, submit a PR to update the list!
@@ -151,6 +152,13 @@ The Windows implementation for polling sockets is using the [wepoll] strategy.
151152
This uses the Windows AFD system to access socket readiness events.
152153

153154
[wepoll]: https://github.com/piscisaureus/wepoll
155+
[issue #1444]: https://github.com/tokio-rs/mio/issues/1444
156+
157+
### Unsupported
158+
159+
* Haiku, see [issue #1472]
160+
161+
[issue #1472]: https://github.com/tokio-rs/mio/issues/1472
154162

155163
## Community
156164

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
trigger: ["master", "v0.6.x"]
2-
pr: ["master", "v0.6.x"]
1+
trigger: ["master", "v0.6.x", "v0.7.x"]
2+
pr: ["master", "v0.6.x", "v0.7.x"]
33

44
jobs:
55
# Check formatting
@@ -27,7 +27,7 @@ jobs:
2727
name: nightly
2828
displayName: Nightly
2929
# Pin nightly to avoid being impacted by breakage
30-
rust_version: nightly-2019-11-14
30+
rust_version: nightly-2021-11-05
3131
benches: true
3232

3333
# This represents the minimum Rust version supported by
@@ -39,7 +39,7 @@ jobs:
3939
parameters:
4040
name: minrust
4141
displayName: Min Rust
42-
rust_version: 1.39.0
42+
rust_version: 1.46.0
4343
cmd: check
4444
cross: true
4545

ci/azure-clippy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ jobs:
33
displayName: Clippy
44

55
pool:
6-
vmImage: ubuntu-16.04
6+
vmImage: ubuntu-18.04
77

88
steps:
99
- template: azure-install-rust.yml

ci/azure-cross-compile.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
vmImage: ubuntu-16.04
2+
vmImage: ubuntu-18.04
33

44
jobs:
55
- job: ${{ parameters.name }}
@@ -15,24 +15,24 @@ jobs:
1515
target: aarch64-apple-ios
1616

1717
Android_ARM:
18-
vmImage: ubuntu-16.04
18+
vmImage: ubuntu-18.04
1919
target: arm-linux-androideabi
2020

2121
Android_ARM64:
22-
vmImage: ubuntu-16.04
22+
vmImage: ubuntu-18.04
2323
target: aarch64-linux-android
2424

2525
Android_32:
26-
vmImage: ubuntu-16.04
26+
vmImage: ubuntu-18.04
2727
target: i686-unknown-linux-gnu
2828

2929
NetBSD:
30-
vmImage: ubuntu-16.04
30+
vmImage: ubuntu-18.04
3131
target: x86_64-unknown-netbsd
3232

33-
Solaris:
34-
vmImage: ubuntu-16.04
35-
target: x86_64-sun-solaris
33+
illumos:
34+
vmImage: ubuntu-18.04
35+
target: x86_64-unknown-illumos
3636

3737
pool:
3838
vmImage: $(vmImage)

ci/azure-minimal-versions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
matrix:
99
Linux:
10-
vmImage: ubuntu-16.04
10+
vmImage: ubuntu-18.04
1111
Windows:
1212
vmImage: vs2017-win2016
1313
pool:

ci/azure-rustfmt.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ jobs:
33
- job: ${{ parameters.name }}
44
displayName: Check rustfmt
55
pool:
6-
vmImage: ubuntu-16.04
6+
vmImage: ubuntu-18.04
77
steps:
88
- template: azure-install-rust.yml
99
parameters:
@@ -12,5 +12,8 @@ jobs:
1212
rustup component add rustfmt
1313
displayName: Install rustfmt
1414
- script: |
15-
cargo fmt --all -- --check
15+
# FIXME: for some reason this doesn't actually check all files.
16+
# So instead we run `rustfmt` directly on each file.
17+
#cargo fmt --all -- --check
18+
find src tests examples -type f -iname "*.rs" | xargs rustfmt --check
1619
displayName: Check formatting

ci/azure-test-stable.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
Linux:
11-
vmImage: ubuntu-16.04
11+
vmImage: ubuntu-18.04
1212

1313
${{ if parameters.cross }}:
1414
MacOS:
@@ -28,8 +28,10 @@ jobs:
2828

2929
- ${{ if eq(parameters.cmd, 'test') }}:
3030
- script: |
31-
cargo install cargo-hack
32-
cargo hack check --feature-powerset --skip guide,extra-docs,tcp,udp,uds,pipe,os-util
31+
# Cargo-hack's dependency bitflags has a higher MSVR then us.
32+
rustup install nightly
33+
rustup run nightly cargo install cargo-hack
34+
cargo hack check --feature-powerset
3335
displayName: Check feature powerset
3436
3537
- script: cargo ${{ parameters.cmd }} --all-features

examples/tcp_server.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// You can run this example from the root of the mio repo:
2-
// cargo run --example tcp_server --features="os-poll tcp"
2+
// cargo run --example tcp_server --features="os-poll net"
33
use mio::event::Event;
44
use mio::net::{TcpListener, TcpStream};
55
use mio::{Events, Interest, Poll, Registry, Token};
@@ -36,7 +36,7 @@ fn main() -> io::Result<()> {
3636

3737
println!("You can connect to the server using `nc`:");
3838
println!(" $ nc 127.0.0.1 9000");
39-
println!("You'll see our welcome message and anything you type we'll be printed here.");
39+
println!("You'll see our welcome message and anything you type will be printed here.");
4040

4141
loop {
4242
poll.poll(&mut events, None)?;
@@ -82,7 +82,9 @@ fn main() -> io::Result<()> {
8282
false
8383
};
8484
if done {
85-
connections.remove(&token);
85+
if let Some(mut connection) = connections.remove(&token) {
86+
poll.registry().deregister(&mut connection)?;
87+
}
8688
}
8789
}
8890
}

examples/udp_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// You can run this example from the root of the mio repo:
2-
// cargo run --example udp_server --features="os-poll udp"
2+
// cargo run --example udp_server --features="os-poll net"
33
use log::warn;
44
use mio::net::UdpSocket;
55
use mio::{Events, Interest, Poll, Token};

src/event/event.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ impl Event {
2525
}
2626

2727
/// Returns true if the event contains readable readiness.
28+
///
29+
/// # Notes
30+
///
31+
/// Out-of-band (OOB) data also triggers readable events. But must
32+
/// application don't actually read OOB data, this could leave an
33+
/// application open to a Denial-of-Service (Dos) attack, see
34+
/// <https://github.com/sandstorm-io/sandstorm-website/blob/58f93346028c0576e8147627667328eaaf4be9fa/_posts/2015-04-08-osx-security-bug.md>.
35+
/// However because Mio uses edge-triggers it will not result in an infinite
36+
/// loop as described in the article above.
2837
pub fn is_readable(&self) -> bool {
2938
sys::event::is_readable(&self.inner)
3039
}

src/event/source.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ use std::io;
3838
///
3939
/// Implementing `Source` on a struct containing a socket:
4040
///
41-
#[cfg_attr(all(feature = "os-poll", features = "net"), doc = "```")]
42-
#[cfg_attr(not(all(feature = "os-poll", features = "net")), doc = "```ignore")]
41+
#[cfg_attr(all(feature = "os-poll", feature = "net"), doc = "```")]
42+
#[cfg_attr(not(all(feature = "os-poll", feature = "net")), doc = "```ignore")]
4343
/// use mio::{Interest, Registry, Token};
4444
/// use mio::event::Source;
4545
/// use mio::net::TcpStream;

0 commit comments

Comments
 (0)