From 117d28f7ba104cb162307772aaf4a3d30367167a Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 4 Mar 2020 15:09:31 +0900 Subject: [PATCH 1/5] Update `actix-connect` to 2.0.0-alpha.1 --- actix-framed/Cargo.toml | 2 +- actix-http/Cargo.toml | 4 ++-- awc/Cargo.toml | 2 +- test-server/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actix-framed/Cargo.toml b/actix-framed/Cargo.toml index dc974e402..133b8083d 100644 --- a/actix-framed/Cargo.toml +++ b/actix-framed/Cargo.toml @@ -32,6 +32,6 @@ log = "0.4" [dev-dependencies] actix-server = "1.0.0" -actix-connect = { version = "1.0.0", features=["openssl"] } +actix-connect = { version = "2.0.0-alpha.1", features=["openssl"] } actix-http-test = { version = "1.0.0", features=["openssl"] } actix-utils = "1.0.3" diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index 356e68405..ea33b42d0 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -45,7 +45,7 @@ actors = ["actix"] [dependencies] actix-service = "1.0.5" actix-codec = "0.2.0" -actix-connect = "1.0.2" +actix-connect = "2.0.0-alpha.1" actix-utils = "1.0.6" actix-rt = "1.0.0" actix-threadpool = "0.3.1" @@ -94,7 +94,7 @@ fail-ure = { version = "0.1.5", package="failure", optional = true } [dev-dependencies] actix-server = "1.0.1" -actix-connect = { version = "1.0.2", features=["openssl"] } +actix-connect = { version = "2.0.0-alpha.1", features=["openssl"] } actix-http-test = { version = "1.0.0", features=["openssl"] } actix-tls = { version = "1.0.0", features=["openssl"] } criterion = "0.3" diff --git a/awc/Cargo.toml b/awc/Cargo.toml index 71b23ece3..ec6ebc77a 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -54,7 +54,7 @@ open-ssl = { version="0.10", package="openssl", optional = true } rust-tls = { version = "0.16.0", package="rustls", optional = true, features = ["dangerous_configuration"] } [dev-dependencies] -actix-connect = { version = "1.0.1", features=["openssl"] } +actix-connect = { version = "2.0.0-alpha.1", features=["openssl"] } actix-web = { version = "2.0.0", features=["openssl"] } actix-http = { version = "2.0.0-alpha.1", features=["openssl"] } actix-http-test = { version = "1.0.0", features=["openssl"] } diff --git a/test-server/Cargo.toml b/test-server/Cargo.toml index 117c1a318..ba8e1c9ea 100644 --- a/test-server/Cargo.toml +++ b/test-server/Cargo.toml @@ -32,7 +32,7 @@ openssl = ["open-ssl", "awc/openssl"] [dependencies] actix-service = "1.0.1" actix-codec = "0.2.0" -actix-connect = "1.0.0" +actix-connect = "2.0.0-alpha.1" actix-utils = "1.0.3" actix-rt = "1.0.0" actix-server = "1.0.0" From b9b52079e0eb27dfff1135df880618539284ca07 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 4 Mar 2020 15:10:23 +0900 Subject: [PATCH 2/5] Update `actix-tls` to 2.0.0-alpha.1 --- Cargo.toml | 2 +- actix-http/Cargo.toml | 4 ++-- awc/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 125008870..af6a728ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ actix-server = "1.0.0" actix-testing = "1.0.0" actix-macros = "0.1.0" actix-threadpool = "0.3.1" -actix-tls = "1.0.0" +actix-tls = "2.0.0-alpha.1" actix-web-codegen = "0.2.0" actix-http = "2.0.0-alpha.1" diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index ea33b42d0..9efe16996 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -49,7 +49,7 @@ actix-connect = "2.0.0-alpha.1" actix-utils = "1.0.6" actix-rt = "1.0.0" actix-threadpool = "0.3.1" -actix-tls = { version = "1.0.0", optional = true } +actix-tls = { version = "2.0.0-alpha.1", optional = true } actix = { version = "0.10.0-alpha.1", optional = true } base64 = "0.11" @@ -96,7 +96,7 @@ fail-ure = { version = "0.1.5", package="failure", optional = true } actix-server = "1.0.1" actix-connect = { version = "2.0.0-alpha.1", features=["openssl"] } actix-http-test = { version = "1.0.0", features=["openssl"] } -actix-tls = { version = "1.0.0", features=["openssl"] } +actix-tls = { version = "2.0.0-alpha.1", features=["openssl"] } criterion = "0.3" futures = "0.3.1" env_logger = "0.7" diff --git a/awc/Cargo.toml b/awc/Cargo.toml index ec6ebc77a..99f0e3eba 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -60,7 +60,7 @@ actix-http = { version = "2.0.0-alpha.1", features=["openssl"] } actix-http-test = { version = "1.0.0", features=["openssl"] } actix-utils = "1.0.3" actix-server = "1.0.0" -actix-tls = { version = "1.0.0", features=["openssl", "rustls"] } +actix-tls = { version = "2.0.0-alpha.1", features=["openssl", "rustls"] } brotli2 = "0.3.2" flate2 = "1.0.13" futures = "0.3.1" From 687dc609dd19602c0af6a3b3bba6acdc1875221c Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 4 Mar 2020 15:11:31 +0900 Subject: [PATCH 3/5] Update `rustls` to 0.17 --- Cargo.toml | 2 +- actix-http/Cargo.toml | 2 +- awc/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index af6a728ab..fa29c225f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,7 +90,7 @@ serde_urlencoded = "0.6.1" time = { version = "0.2.7", default-features = false, features = ["std"] } url = "2.1" open-ssl = { version="0.10", package = "openssl", optional = true } -rust-tls = { version = "0.16.0", package = "rustls", optional = true } +rust-tls = { version = "0.17.0", package = "rustls", optional = true } [dev-dependencies] actix = "0.10.0-alpha.1" diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index 9efe16996..df9653aa3 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -102,7 +102,7 @@ futures = "0.3.1" env_logger = "0.7" serde_derive = "1.0" open-ssl = { version="0.10", package = "openssl" } -rust-tls = { version="0.16", package = "rustls" } +rust-tls = { version="0.17", package = "rustls" } [[bench]] name = "content-length" diff --git a/awc/Cargo.toml b/awc/Cargo.toml index 99f0e3eba..d27615f7a 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -51,7 +51,7 @@ serde = "1.0" serde_json = "1.0" serde_urlencoded = "0.6.1" open-ssl = { version="0.10", package="openssl", optional = true } -rust-tls = { version = "0.16.0", package="rustls", optional = true, features = ["dangerous_configuration"] } +rust-tls = { version = "0.17.0", package="rustls", optional = true, features = ["dangerous_configuration"] } [dev-dependencies] actix-connect = { version = "2.0.0-alpha.1", features=["openssl"] } From 9d661dc4f3edf9deca8e13d517f95151bdeb4111 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 4 Mar 2020 15:20:14 +0900 Subject: [PATCH 4/5] Update changelog --- CHANGES.md | 4 ++-- actix-http/CHANGES.md | 10 +++++++--- test-server/CHANGES.md | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ab9caa7bd..da4a77a80 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,10 +10,10 @@ ### Changed * Use `sha-1` crate instead of unmaintained `sha1` crate - * Skip empty chunks when returning response from a `Stream` #1308 - * Update the `time` dependency to 0.2.7 +* Update `actix-tls` dependency to 2.0.0-alpha.1 +* Update `rustls` dependency to 0.17 ## [2.0.0] - 2019-12-25 diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 229fcbbae..4ec981174 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -1,15 +1,19 @@ # Changes +## [2.0.0-alpha.2] - someday + +### Changed + +* Update `actix-connect` and `actix-tls` dependency to 2.0.0-alpha.1 + + ## [2.0.0-alpha.1] - 2020-02-27 ### Changed * Update the `time` dependency to 0.2.7. - * Moved actors messages support from actix crate, enabled with feature `actors`. - * Breaking change: trait MessageBody requires Unpin and accepting Pin<&mut Self> instead of &mut self in the poll_next(). - * MessageBody is not implemented for &'static [u8] anymore. ### Fixed diff --git a/test-server/CHANGES.md b/test-server/CHANGES.md index 96c010355..3a990a594 100644 --- a/test-server/CHANGES.md +++ b/test-server/CHANGES.md @@ -3,6 +3,7 @@ ## [Unreleased] - 2020-xx-xx * Update the `time` dependency to 0.2.7 +* Update `actix-connect` dependency to 2.0.0-alpha.1 ## [1.0.0] - 2019-12-13 From e90950fee137f3e161a975bbb27b5aab5d25306f Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Wed, 4 Mar 2020 11:27:58 -0500 Subject: [PATCH 5/5] Re-apply commit 2cf7b3ad20fb823314426a5e33b0805045ec1d8a This ended up getting reverted by #1367, which re-introduced an unsound use of `Pin::new_unchecked` See my original PR #1374 for the reasoning behind this change. --- actix-http/src/h1/dispatcher.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 6276653d3..ffdcd8d9b 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -73,7 +73,7 @@ where U::Error: fmt::Display, { Normal(#[pin] InnerDispatcher), - Upgrade(#[pin] U::Future), + Upgrade(Pin>), } #[pin_project] @@ -123,8 +123,8 @@ where B: MessageBody, { None, - ExpectCall(#[pin] X::Future), - ServiceCall(#[pin] S::Future), + ExpectCall(Pin>), + ServiceCall(Pin>), SendPayload(#[pin] ResponseBody), } @@ -391,11 +391,11 @@ where } None => None, }, - State::ExpectCall(fut) => match fut.poll(cx) { + State::ExpectCall(fut) => match fut.as_mut().poll(cx) { Poll::Ready(Ok(req)) => { self.as_mut().send_continue(); this = self.as_mut().project(); - this.state.set(State::ServiceCall(this.service.call(req))); + this.state.set(State::ServiceCall(Box::pin(this.service.call(req)))); continue; } Poll::Ready(Err(e)) => { @@ -405,7 +405,7 @@ where } Poll::Pending => None, }, - State::ServiceCall(fut) => match fut.poll(cx) { + State::ServiceCall(fut) => match fut.as_mut().poll(cx) { Poll::Ready(Ok(res)) => { let (res, body) = res.into().replace_body(()); let state = self.as_mut().send_response(res, body)?; @@ -485,8 +485,8 @@ where ) -> Result, DispatchError> { // Handle `EXPECT: 100-Continue` header let req = if req.head().expect() { - let mut task = self.as_mut().project().expect.call(req); - match unsafe { Pin::new_unchecked(&mut task) }.poll(cx) { + let mut task = Box::pin(self.as_mut().project().expect.call(req)); + match task.as_mut().poll(cx) { Poll::Ready(Ok(req)) => { self.as_mut().send_continue(); req @@ -504,8 +504,8 @@ where }; // Call service - let mut task = self.as_mut().project().service.call(req); - match unsafe { Pin::new_unchecked(&mut task) }.poll(cx) { + let mut task = Box::pin(self.as_mut().project().service.call(req)); + match task.as_mut().poll(cx) { Poll::Ready(Ok(res)) => { let (res, body) = res.into().replace_body(()); self.send_response(res, body) @@ -807,7 +807,7 @@ where self.as_mut() .project() .inner - .set(DispatcherState::Upgrade(upgrade)); + .set(DispatcherState::Upgrade(Box::pin(upgrade))); return self.poll(cx); } @@ -855,7 +855,7 @@ where } } } - DispatcherState::Upgrade(fut) => fut.poll(cx).map_err(|e| { + DispatcherState::Upgrade(fut) => fut.as_mut().poll(cx).map_err(|e| { error!("Upgrade handler error: {}", e); DispatchError::Upgrade }),