1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

* fix force_close

* shutdown io before exit

* fix response creation with body from pool
This commit is contained in:
Nikolay Kim
2018-01-03 18:21:34 -08:00
parent 8348c830e2
commit e439d0546b
9 changed files with 48 additions and 46 deletions

View File

@@ -14,7 +14,6 @@ use actix::dev::{AsyncContextApi, ActorAddressCell, ActorItemsCell, ActorWaitCel
use body::{Body, Binary};
use error::{Error, Result};
use httprequest::HttpRequest;
use httpresponse::HttpResponse;
pub trait ActorHttpContext: 'static {
@@ -124,16 +123,6 @@ impl<A, S: 'static> HttpContext<A, S> where A: Actor<Context=Self> {
self.act = Some(actor);
self
}
pub fn with_actor(mut self, actor: A, mut resp: HttpResponse) -> Result<HttpResponse> {
if self.act.is_some() {
panic!("Actor is set already");
}
self.act = Some(actor);
resp.replace_body(Body::Actor(Box::new(self)));
Ok(resp)
}
}
impl<A, S> HttpContext<A, S> where A: Actor<Context=Self> {