mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
stop http context immediately
This commit is contained in:
parent
58a5d493b7
commit
78967dea13
@ -75,7 +75,8 @@ impl<A, S> AsyncContext<A> for HttpContext<A, S> where A: Actor<Context=Self>
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
fn waiting(&self) -> bool {
|
||||
self.inner.wating()
|
||||
self.inner.waiting() || self.inner.state() == ActorState::Stopping ||
|
||||
self.inner.state() == ActorState::Stopped
|
||||
}
|
||||
#[inline]
|
||||
fn cancel_future(&mut self, handle: SpawnHandle) -> bool {
|
||||
|
@ -420,7 +420,7 @@ impl Inner {
|
||||
}
|
||||
|
||||
pub fn readall(&mut self) -> Option<Bytes> {
|
||||
let len = self.items.iter().fold(0, |cur, item| cur + item.len());
|
||||
let len = self.items.iter().map(|b| b.len()).sum();
|
||||
if len > 0 {
|
||||
let mut buf = BytesMut::with_capacity(len);
|
||||
for item in &self.items {
|
||||
|
@ -58,7 +58,7 @@ impl<A, S> AsyncContext<A> for WebsocketContext<A, S> where A: Actor<Context=Sel
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
fn waiting(&self) -> bool {
|
||||
self.inner.wating() || self.inner.state() == ActorState::Stopping ||
|
||||
self.inner.waiting() || self.inner.state() == ActorState::Stopping ||
|
||||
self.inner.state() == ActorState::Stopped
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user