diff --git a/CHANGES.md b/CHANGES.md
index 88f4ffc25..f83e7b5bd 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -15,6 +15,8 @@
* Re-use `BinaryBody` for `Frame::Payload`
+* Stop http actor on `write_eof`
+
* Fix disconnection handling.
diff --git a/src/context.rs b/src/context.rs
index 798a480fb..81fcc4a65 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -50,7 +50,6 @@ impl ActorContext for HttpContext where A: Actor + Route
if self.state == ActorState::Running {
self.state = ActorState::Stopping;
}
- self.write_eof();
}
/// Terminate actor execution
@@ -134,9 +133,10 @@ impl HttpContext where A: Actor + 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