check stopping condition in framed cell
@@ -175,6 +175,7 @@ impl<A, Io, Codec> ActorFuture for FramedWrapper<A, Io, Codec>
// check framed stream
if !inner.flags.intersects(FramedFlags::CLOSING | FramedFlags::STREAM_CLOSED) {
+ while !ctx.waiting() {
match framed.poll() {
Ok(Async::Ready(Some(msg))) => {
not_ready = false;
@@ -183,11 +184,14 @@ impl<A, Io, Codec> ActorFuture for FramedWrapper<A, Io, Codec>
Ok(Async::Ready(None)) => {
inner.flags |= FramedFlags::SINK_CLOSED | FramedFlags::STREAM_CLOSED;
<A as FramedActor<Io, Codec>>::closed(act, None, ctx);
+ break
}
- Ok(Async::NotReady) => (),
+ Ok(Async::NotReady) => break,
Err(err) => {
inner.flags |= FramedFlags::SINK_CLOSED | FramedFlags::STREAM_CLOSED;
<A as FramedActor<Io, Codec>>::handle(act, Err(err), ctx);
+ break
+ }
}
}
}
