diff --git a/Cargo.toml b/Cargo.toml index 4b163aed3..9d29f7a3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ build = "build.rs" [badges] travis-ci = { repository = "actix/actix-web", branch = "master" } -appveyor = { repository = "fafhrd91/actix-web-hdy9d" } +appveyor = { repository = "actix/actix-web" } codecov = { repository = "actix/actix-web", branch = "master", service = "github" } [lib] diff --git a/README.md b/README.md index da6bb866f..b634cec63 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,6 @@ fn main() { .route_handler("/", StaticFiles::new("examples/static/", true))) .serve::<_, ()>("127.0.0.1:8080").unwrap(); - println!("Started http server: 127.0.0.1:8080"); Arbiter::system().send(msgs::SystemExit(0)); let _ = sys.run(); } diff --git a/examples/websocket-chat/src/main.rs b/examples/websocket-chat/src/main.rs index 1e436d166..14f93b915 100644 --- a/examples/websocket-chat/src/main.rs +++ b/examples/websocket-chat/src/main.rs @@ -211,10 +211,10 @@ fn main() { // redirect to websocket.html .resource("/", |r| r.handler(Method::GET, |req, payload, state| { - httpcodes::HTTPFound - .builder() - .header("LOCATION", "/static/websocket.html") - .body(Body::Empty) + Ok(httpcodes::HTTPFound + .builder() + .header("LOCATION", "/static/websocket.html") + .body(Body::Empty)?) })) // websocket .resource("/ws/", |r| r.get::()) diff --git a/src/context.rs b/src/context.rs index 81fcc4a65..04f39e3fd 100644 --- a/src/context.rs +++ b/src/context.rs @@ -35,6 +35,7 @@ pub struct HttpContext where A: Actor> + Route, impl IoContext for HttpContext where A: Actor + Route { fn disconnected(&mut self) { + self.items.stop(); self.disconnected = true; if self.state == ActorState::Running { self.state = ActorState::Stopping; @@ -46,6 +47,7 @@ impl ActorContext for HttpContext where A: Actor + Route { /// Stop actor execution fn stop(&mut self) { + self.items.stop(); self.address.close(); if self.state == ActorState::Running { self.state = ActorState::Stopping; @@ -85,6 +87,10 @@ impl AsyncContext for HttpContext where A: Actor + Route self.modified = true; self.items.cancel_future(handle) } + + fn cancel_future_on_stop(&mut self, handle: SpawnHandle) { + self.items.cancel_future_on_stop(handle) + } } #[doc(hidden)]