Skip to content

Commit cd06952

Browse files
committed
Fix readiness of buffered stream
If we see an empty slot then we're not immediately ready, but rather ready when the underlying stream is ready, so propagate the readiness notification through to that. Closes rust-lang#57
1 parent 2cc22c1 commit cd06952

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/stream/buffered.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ impl<S> Stream for Buffered<S>
107107
// If we've got an empty slot, then we're immediately ready to go.
108108
for slot in self.futures.iter() {
109109
if let State::Empty = *slot {
110-
return task.notify()
110+
self.stream.schedule(task);
111+
break
111112
}
112113
}
113114

0 commit comments

Comments
 (0)