From a751899aad2a67fb4fea0a90e455a2071720638e Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 15 Jan 2020 11:40:15 -0800 Subject: [PATCH] Fixed unsoundness in AndThenService impl #83 --- actix-service/CHANGES.md | 6 ++++++ actix-service/Cargo.toml | 2 +- actix-service/src/pipeline.rs | 9 ++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/actix-service/CHANGES.md b/actix-service/CHANGES.md index d223e81a..61d082d3 100644 --- a/actix-service/CHANGES.md +++ b/actix-service/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## [1.0.3] - 2020-01-15 + +### Fixed + +* Fixed unsoundness in `AndThenService` impl + ## [1.0.2] - 2020-01-08 ### Added diff --git a/actix-service/Cargo.toml b/actix-service/Cargo.toml index 125ec10a..e6546972 100644 --- a/actix-service/Cargo.toml +++ b/actix-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-service" -version = "1.0.2" +version = "1.0.3" authors = ["Nikolay Kim "] description = "Actix service" keywords = ["network", "framework", "async", "futures"] diff --git a/actix-service/src/pipeline.rs b/actix-service/src/pipeline.rs index d6107ce4..4b0ecc25 100644 --- a/actix-service/src/pipeline.rs +++ b/actix-service/src/pipeline.rs @@ -50,7 +50,7 @@ impl Pipeline { where Self: Sized, F: IntoService, - U: Service, + U: Service + 'static, { Pipeline { service: AndThenService::new(self.service, service.into_service()), @@ -69,7 +69,7 @@ impl Pipeline { where Self: Sized, I: IntoService, - U: Service, + U: Service + 'static, F: FnMut(T::Response, &mut U) -> Fut, Fut: Future>, Err: From + From, @@ -88,7 +88,7 @@ impl Pipeline { where Self: Sized, F: IntoService, - U: Service, Error = T::Error>, + U: Service, Error = T::Error> + 'static, { Pipeline { service: ThenService::new(self.service, service.into_service()), @@ -179,6 +179,7 @@ impl PipelineFactory { Error = T::Error, InitError = T::InitError, >, + U::Service: 'static, { PipelineFactory { factory: AndThenServiceFactory::new(self.factory, factory.into_factory()), @@ -199,6 +200,7 @@ impl PipelineFactory { T::Config: Clone, I: IntoServiceFactory, U: ServiceFactory, + U::Service: 'static, F: FnMut(T::Response, &mut U::Service) -> Fut + Clone, Fut: Future>, Err: From + From, @@ -225,6 +227,7 @@ impl PipelineFactory { Error = T::Error, InitError = T::InitError, >, + U::Service: 'static, { PipelineFactory { factory: ThenServiceFactory::new(self.factory, factory.into_factory()),