Skip to content

Commit 835121d

Browse files
committed
poll: Do not clear readiness on short read/writes.
The new mio_unsupported_force_poll_poll behaviour works the same as Windows (using level-triggered APIs to mimic edge-triggered ones) and it depends on intercepting an EAGAIN result to start polling the fd again. Closes #5866
1 parent 91ad76c commit 835121d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tokio/src/io/poll_evented.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ feature! {
166166
Ok(n) => {
167167
// if we read a partially full buffer, this is sufficient on unix to show
168168
// that the socket buffer has been drained
169-
if n > 0 && (!cfg!(windows) && n < len) {
169+
if n > 0 && (!cfg!(windows) && !cfg!(mio_unsupported_force_poll_poll) && n < len) {
170170
self.registration.clear_readiness(evt);
171171
}
172172

@@ -197,7 +197,7 @@ feature! {
197197
Ok(n) => {
198198
// if we write only part of our buffer, this is sufficient on unix to show
199199
// that the socket buffer is full
200-
if n > 0 && (!cfg!(windows) && n < buf.len()) {
200+
if n > 0 && (!cfg!(windows) && !cfg!(mio_unsupported_force_poll_poll) && n < buf.len()) {
201201
self.registration.clear_readiness(evt);
202202
}
203203

0 commit comments

Comments
 (0)