diff options
author | Sean McArthur <sean@seanmonstar.com> | 2020-09-25 16:34:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 16:34:40 -0700 |
commit | dfdfd61372cca02087c0e2773dc978d03235bc51 (patch) | |
tree | c3401db75087a6df56b9eba06c1dbdb8cee6caa0 /tokio/src | |
parent | 55d932a21fd4c5fa298ca3cfdcb1388dbbf43dd0 (diff) |
Fix readiness future eagerly consuming entire socket readiness (#2887)
In the `readiness` future, before inserting a waiter into the list, the current socket readiness is eagerly checked. However, it would return as a `ReadyEvent` the entire socket readiness, instead of just the interest desired from `readiness(interest)`. This would result in the later call to `clear_readiness(event)` removing all of it.
Closes #2886
Diffstat (limited to 'tokio/src')
-rw-r--r-- | tokio/src/io/driver/scheduled_io.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio/src/io/driver/scheduled_io.rs b/tokio/src/io/driver/scheduled_io.rs index 88daeb2d..f63fd7ab 100644 --- a/tokio/src/io/driver/scheduled_io.rs +++ b/tokio/src/io/driver/scheduled_io.rs @@ -371,7 +371,7 @@ cfg_io_readiness! { // Currently ready! let tick = TICK.unpack(curr) as u8; *state = State::Done; - return Poll::Ready(ReadyEvent { readiness, tick }); + return Poll::Ready(ReadyEvent { readiness: interest, tick }); } // Wasn't ready, take the lock (and check again while locked). |