mirror of
https://github.com/actix/actix-web.git
synced 2024-12-30 03:50:42 +00:00
proper check for actor context poll
This commit is contained in:
parent
5baf15822a
commit
b16f2d5f05
2 changed files with 4 additions and 3 deletions
|
@ -188,7 +188,7 @@ impl<A, S> ActorHttpContext for HttpContext<A, S> where A: Actor<Context=Self>,
|
||||||
mem::transmute(self as &mut HttpContext<A, S>)
|
mem::transmute(self as &mut HttpContext<A, S>)
|
||||||
};
|
};
|
||||||
|
|
||||||
if self.inner.started() && self.inner.alive() {
|
if !self.inner.started() || self.inner.started() && self.inner.alive() {
|
||||||
match self.inner.poll(ctx) {
|
match self.inner.poll(ctx) {
|
||||||
Ok(Async::NotReady) | Ok(Async::Ready(())) => (),
|
Ok(Async::NotReady) | Ok(Async::Ready(())) => (),
|
||||||
Err(_) => return Err(ErrorInternalServerError("error").into()),
|
Err(_) => return Err(ErrorInternalServerError("error").into()),
|
||||||
|
|
|
@ -204,8 +204,9 @@ impl<A, S> ActorHttpContext for WebsocketContext<A, S> where A: Actor<Context=Se
|
||||||
mem::transmute(self as &mut WebsocketContext<A, S>)
|
mem::transmute(self as &mut WebsocketContext<A, S>)
|
||||||
};
|
};
|
||||||
|
|
||||||
if self.inner.started() && self.inner.alive() && self.inner.poll(ctx).is_err() {
|
if (!self.inner.started() || self.inner.started() && self.inner.alive())
|
||||||
return Err(ErrorInternalServerError("error").into())
|
&& self.inner.poll(ctx).is_err() {
|
||||||
|
return Err(ErrorInternalServerError("error").into())
|
||||||
}
|
}
|
||||||
|
|
||||||
// frames
|
// frames
|
||||||
|
|
Loading…
Reference in a new issue