mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-30 10:32:55 +01:00
stop http actor on write_eof
This commit is contained in:
parent
dec4140733
commit
122fcd6881
@ -15,6 +15,8 @@
|
||||
|
||||
* Re-use `BinaryBody` for `Frame::Payload`
|
||||
|
||||
* Stop http actor on `write_eof`
|
||||
|
||||
* Fix disconnection handling.
|
||||
|
||||
|
||||
|
@ -50,7 +50,6 @@ impl<A> ActorContext for HttpContext<A> where A: Actor<Context=Self> + Route
|
||||
if self.state == ActorState::Running {
|
||||
self.state = ActorState::Stopping;
|
||||
}
|
||||
self.write_eof();
|
||||
}
|
||||
|
||||
/// Terminate actor execution
|
||||
@ -134,9 +133,10 @@ impl<A> HttpContext<A> where A: Actor<Context=Self> + Route {
|
||||
self.stream.push_back(Frame::Payload(Some(data.into())))
|
||||
}
|
||||
|
||||
/// Indicate end of streamimng payload
|
||||
/// Indicate end of streamimng payload. Also this method calls `Self::close`.
|
||||
pub fn write_eof(&mut self) {
|
||||
self.stream.push_back(Frame::Payload(None))
|
||||
self.stream.push_back(Frame::Payload(None));
|
||||
self.stop();
|
||||
}
|
||||
|
||||
/// Returns drain future
|
||||
|
Loading…
Reference in New Issue
Block a user