Skip to content

Commit

Permalink
Fix readiness of buffered stream
Browse files Browse the repository at this point in the history
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 #57
  • Loading branch information
alexcrichton committed Aug 15, 2016
1 parent 2cc22c1 commit cd06952
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stream/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ impl<S> Stream for Buffered<S>
// If we've got an empty slot, then we're immediately ready to go.
for slot in self.futures.iter() {
if let State::Empty = *slot {
return task.notify()
self.stream.schedule(task);
break
}
}

Expand Down

0 comments on commit cd06952

Please sign in to comment.