1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 07:53:00 +01:00

mark context as modified after writing data

This commit is contained in:
Nikolay Kim 2018-02-27 18:05:06 -08:00
parent e2c8f17c2c
commit 1e2aa4fc90
2 changed files with 3 additions and 0 deletions

View File

@ -164,6 +164,7 @@ impl<A, S> HttpContext<A, S> where A: Actor<Context=Self> {
self.stream = Some(SmallVec::new()); self.stream = Some(SmallVec::new());
} }
self.stream.as_mut().map(|s| s.push(frame)); self.stream.as_mut().map(|s| s.push(frame));
self.inner.modify();
} }
/// Handle of the running future /// Handle of the running future

View File

@ -112,6 +112,7 @@ impl<A, S> WebsocketContext<A, S> where A: Actor<Context=Self> {
} }
let stream = self.stream.as_mut().unwrap(); let stream = self.stream.as_mut().unwrap();
stream.push(ContextFrame::Chunk(Some(data))); stream.push(ContextFrame::Chunk(Some(data)));
self.inner.modify();
} else { } else {
warn!("Trying to write to disconnected response"); warn!("Trying to write to disconnected response");
} }
@ -179,6 +180,7 @@ impl<A, S> WebsocketContext<A, S> where A: Actor<Context=Self> {
self.stream = Some(SmallVec::new()); self.stream = Some(SmallVec::new());
} }
self.stream.as_mut().map(|s| s.push(frame)); self.stream.as_mut().map(|s| s.push(frame));
self.inner.modify();
} }
/// Handle of the running future /// Handle of the running future