From e354c6df92451b4b3738f08c2c5b5ad1c4cb1996 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 9 Feb 2019 21:39:17 -0800 Subject: [PATCH] Drop service response --- actix-server/CHANGES.md | 13 ++++++++++--- actix-server/Cargo.toml | 4 ++-- actix-server/src/services.rs | 16 ++++++++-------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/actix-server/CHANGES.md b/actix-server/CHANGES.md index 483c3b65..377a5873 100644 --- a/actix-server/CHANGES.md +++ b/actix-server/CHANGES.md @@ -1,8 +1,15 @@ # Changes +## [0.2.1] - 2019-02-09 + +### Changes + +* Drop service response + + ## [0.2.0] - 2019-02-01 -## Changes +### Changes * Migrate to actix-service 0.2 @@ -11,14 +18,14 @@ ## [0.1.3] - 2018-12-21 -## Fixed +### Fixed * Fix max concurrent connections handling ## [0.1.2] - 2018-12-12 -## Changed +### Changed * rename ServiceConfig::rt() to ServiceConfig::apply() diff --git a/actix-server/Cargo.toml b/actix-server/Cargo.toml index 3255c489..29d020f8 100644 --- a/actix-server/Cargo.toml +++ b/actix-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-server" -version = "0.2.0" +version = "0.2.1" authors = ["Nikolay Kim "] description = "Actix server - General purpose tcp server" keywords = ["network", "framework", "async", "futures"] @@ -33,7 +33,7 @@ ssl = ["openssl", "tokio-openssl"] rust-tls = ["rustls", "tokio-rustls", "webpki", "webpki-roots"] [dependencies] -actix-service = "0.2.0" +actix-service = "0.2.1" actix-rt = "0.1.0" log = "0.4" diff --git a/actix-server/src/services.rs b/actix-server/src/services.rs index 7152185a..1340f890 100644 --- a/actix-server/src/services.rs +++ b/actix-server/src/services.rs @@ -23,13 +23,13 @@ pub enum ServerMessage { } pub trait StreamServiceFactory: Send + Clone + 'static { - type NewService: NewService; + type NewService: NewService; fn create(&self) -> Self::NewService; } pub trait ServiceFactory: Send + Clone + 'static { - type NewService: NewService; + type NewService: NewService; fn create(&self) -> Self::NewService; } @@ -63,7 +63,7 @@ impl StreamService { impl Service for StreamService where - T: Service, + T: Service, T::Future: 'static, T::Error: 'static, { @@ -86,7 +86,7 @@ where if let Ok(stream) = stream { spawn(self.service.call(stream).then(move |res| { drop(guard); - res.map_err(|_| ()) + res.map_err(|_| ()).map(|_| ()) })); ok(()) } else { @@ -110,7 +110,7 @@ impl ServerService { impl Service for ServerService where - T: Service, + T: Service, T::Future: 'static, T::Error: 'static, { @@ -126,7 +126,7 @@ where fn call(&mut self, (guard, req): (Option, ServerMessage)) -> Self::Future { spawn(self.service.call(req).then(move |res| { drop(guard); - res.map_err(|_| ()) + res.map_err(|_| ()).map(|_| ()) })); ok(()) } @@ -241,7 +241,7 @@ impl InternalServiceFactory for Box { impl ServiceFactory for F where F: Fn() -> T + Send + Clone + 'static, - T: NewService, + T: NewService, { type NewService = T; @@ -253,7 +253,7 @@ where impl StreamServiceFactory for F where F: Fn() -> T + Send + Clone + 'static, - T: NewService, + T: NewService, { type NewService = T;