From b8a612d21e773eff443ef02d7d937b4262eeaaf3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 01:45:57 +0100 Subject: [PATCH 01/14] build(deps): bump rand from 0.9.0 to 0.9.1 (#3625) Bumps [rand](https://github.com/rust-random/rand) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.9.0...rand_core-0.9.1) --- updated-dependencies: - dependency-name: rand dependency-version: 0.9.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2caac3e90..66055bfef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,7 +109,7 @@ dependencies = [ "openssl", "percent-encoding", "pin-project-lite", - "rand 0.9.0", + "rand 0.9.1", "rcgen", "regex", "rustls 0.23.25", @@ -185,7 +185,7 @@ dependencies = [ "memchr", "mime", "multer", - "rand 0.9.0", + "rand 0.9.1", "serde", "serde_json", "serde_plain", @@ -383,7 +383,7 @@ dependencies = [ "once_cell", "openssl", "pin-project-lite", - "rand 0.9.0", + "rand 0.9.1", "rcgen", "regex", "regex-lite", @@ -650,7 +650,7 @@ dependencies = [ "openssl", "percent-encoding", "pin-project-lite", - "rand 0.9.0", + "rand 0.9.1", "rcgen", "rustls 0.20.9", "rustls 0.21.12", @@ -2396,13 +2396,12 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", - "zerocopy", ] [[package]] From 741ca85d4ad1511dffa6f97d770aa6c7267bea22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 01:46:11 +0100 Subject: [PATCH 02/14] build(deps): bump proc-macro2 from 1.0.94 to 1.0.95 (#3626) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.94 to 1.0.95. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.94...1.0.95) --- updated-dependencies: - dependency-name: proc-macro2 dependency-version: 1.0.95 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66055bfef..96cd56efb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2361,9 +2361,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] From 5939af88b396375567224ea5a0235a11537380a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 01:46:28 +0100 Subject: [PATCH 03/14] build(deps): bump codecov/codecov-action from 5.4.0 to 5.4.2 (#3628) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.0 to 5.4.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5.4.0...v5.4.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.4.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 496a22e2a..c6960e64d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -32,7 +32,7 @@ jobs: run: just test-coverage-codecov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5.4.0 + uses: codecov/codecov-action@v5.4.2 with: files: codecov.json fail_ci_if_error: true From e27e1e380692575ce08a3b7cb0825ed029385100 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 01:46:43 +0100 Subject: [PATCH 04/14] build(deps): bump taiki-e/install-action from 2.49.45 to 2.49.50 (#3629) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.49.45 to 2.49.50. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.49.45...v2.49.50) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.49.50 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 5ae95d5d2..72cffbdc3 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.49.45 + uses: taiki-e/install-action@v2.49.50 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.49.45 + uses: taiki-e/install-action@v2.49.50 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1556d6b3..1c2ecdeea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.49.45 + uses: taiki-e/install-action@v2.49.50 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.49.45 + uses: taiki-e/install-action@v2.49.50 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c6960e64d..2d2aa1c5e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.49.45 + uses: taiki-e/install-action@v2.49.50 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 28fd44494..b1e34a57e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - name: Install just - uses: taiki-e/install-action@v2.49.45 + uses: taiki-e/install-action@v2.49.50 with: tool: just From ad73cdc823dd53ab1b3449fedfc3806173e8368f Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 9 May 2025 20:15:36 +0100 Subject: [PATCH 05/14] build: rework justfile toolchain --- .cspell.yml | 1 + justfile | 31 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.cspell.yml b/.cspell.yml index 95a3e2f90..83c29f0af 100644 --- a/.cspell.yml +++ b/.cspell.yml @@ -1,3 +1,4 @@ version: "0.2" words: - actix + - rustup diff --git a/justfile b/justfile index 8449c3056..9d3ad5e31 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,8 @@ _list: @just --list +toolchain := "" + # Format workspace. fmt: just --unstable --fmt @@ -10,11 +12,11 @@ fmt: # Downgrade dependencies necessary to run MSRV checks/tests. [private] downgrade-for-msrv: - cargo update -p=clap --precise=4.4.18 # next ver: 1.74.0 - cargo update -p=divan --precise=0.1.15 # next ver: 1.80.0 - cargo update -p=litemap --precise=0.7.4 # next ver: 1.81.0 - cargo update -p=zerofrom --precise=0.1.5 # next ver: 1.81.0 - cargo update -p=half --precise=2.4.1 # next ver: 1.81.0 + cargo {{ toolchain }} update -p=divan --precise=0.1.15 # next ver: 1.80.0 + cargo {{ toolchain }} update -p=half --precise=2.4.1 # next ver: 1.81.0 + cargo {{ toolchain }} update -p=litemap --precise=0.7.4 # next ver: 1.81.0 + cargo {{ toolchain }} update -p=zerofrom --precise=0.1.5 # next ver: 1.81.0 + cargo {{ toolchain }} update -p=idna_adapter --precise=1.2.0 # next ver: 1.82.0 msrv := ``` cargo metadata --format-version=1 \ @@ -40,41 +42,42 @@ check-default: cargo hack --workspace check # Run Clippy over workspace. -check toolchain="": && (clippy toolchain) +check: && clippy # Run Clippy over workspace. -clippy toolchain="": +clippy: cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }} # Test workspace using MSRV. -test-msrv: downgrade-for-msrv (test msrv_rustup) +test-msrv: downgrade-for-msrv + @just toolchain={{ msrv_rustup }} test # Test workspace code. -test toolchain="": +test: cargo {{ toolchain }} test --lib --tests -p=actix-web-codegen --all-features cargo {{ toolchain }} test --lib --tests -p=actix-multipart-derive --all-features cargo {{ toolchain }} nextest run --no-tests=warn -p=actix-router --no-default-features cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-web-codegen --exclude=actix-multipart-derive {{ all_crate_features }} --filter-expr="not test(test_reading_deflate_encoding_large_random_rustls)" # Test workspace docs. -test-docs toolchain="": && doc +test-docs: && doc cargo {{ toolchain }} test --doc --workspace {{ all_crate_features }} --no-fail-fast -- --nocapture # Test workspace. -test-all toolchain="": (test toolchain) (test-docs toolchain) +test-all: test test-docs # Test workspace and collect coverage info. [private] -test-coverage toolchain="": +test-coverage: cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }} cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }} # Test workspace and generate Codecov report. -test-coverage-codecov toolchain="": (test-coverage toolchain) +test-coverage-codecov: test-coverage cargo {{ toolchain }} llvm-cov report --doctests --codecov --output-path=codecov.json # Test workspace and generate LCOV report. -test-coverage-lcov toolchain="": (test-coverage toolchain) +test-coverage-lcov: test-coverage cargo {{ toolchain }} llvm-cov report --doctests --lcov --output-path=lcov.info # Document crates in workspace. From 7eea3d36570f8a6e227e72cbb7e6fb51a840ce10 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 9 May 2025 20:21:02 +0100 Subject: [PATCH 06/14] chore: address clippy lints --- .cspell.yml | 1 + actix-http/examples/streaming-error.rs | 2 +- actix-http/src/body/utils.rs | 2 +- actix-http/src/encoding/decoder.rs | 5 +---- actix-http/src/encoding/encoder.rs | 3 +-- actix-http/src/error.rs | 10 +++++----- actix-http/src/h1/encoder.rs | 6 +++--- actix-web-actors/src/ws.rs | 14 +++++--------- actix-web/src/server.rs | 5 +---- awc/src/client/pool.rs | 5 ++--- 10 files changed, 21 insertions(+), 32 deletions(-) diff --git a/.cspell.yml b/.cspell.yml index 83c29f0af..813349383 100644 --- a/.cspell.yml +++ b/.cspell.yml @@ -1,4 +1,5 @@ version: "0.2" words: - actix + - httparse - rustup diff --git a/actix-http/examples/streaming-error.rs b/actix-http/examples/streaming-error.rs index 39f214fa1..8d494b64e 100644 --- a/actix-http/examples/streaming-error.rs +++ b/actix-http/examples/streaming-error.rs @@ -31,7 +31,7 @@ async fn main() -> io::Result<()> { actix_rt::time::sleep(Duration::from_secs(1)).await; - yield Err(io::Error::new(io::ErrorKind::Other, "abc")); + yield Err(io::Error::other("abc")); }))) }) .tcp() diff --git a/actix-http/src/body/utils.rs b/actix-http/src/body/utils.rs index b8bfa96cf..a234222aa 100644 --- a/actix-http/src/body/utils.rs +++ b/actix-http/src/body/utils.rs @@ -190,7 +190,7 @@ mod tests { #[actix_rt::test] async fn to_body_limit_error() { - let err_stream = stream::once(async { Err(io::Error::new(io::ErrorKind::Other, "")) }); + let err_stream = stream::once(async { Err(io::Error::other("")) }); let body = SizedStream::new(8, err_stream); // not too big, but propagates error from body stream assert!(to_bytes_limited(body, 10).await.unwrap().is_err()); diff --git a/actix-http/src/encoding/decoder.rs b/actix-http/src/encoding/decoder.rs index cda534d60..1247c0a55 100644 --- a/actix-http/src/encoding/decoder.rs +++ b/actix-http/src/encoding/decoder.rs @@ -100,10 +100,7 @@ where loop { if let Some(ref mut fut) = this.fut { let (chunk, decoder) = ready!(Pin::new(fut).poll(cx)).map_err(|_| { - PayloadError::Io(io::Error::new( - io::ErrorKind::Other, - "Blocking task was cancelled unexpectedly", - )) + PayloadError::Io(io::Error::other("Blocking task was cancelled unexpectedly")) })??; *this.decoder = Some(decoder); diff --git a/actix-http/src/encoding/encoder.rs b/actix-http/src/encoding/encoder.rs index 735dca679..0da95c462 100644 --- a/actix-http/src/encoding/encoder.rs +++ b/actix-http/src/encoding/encoder.rs @@ -183,8 +183,7 @@ where if let Some(ref mut fut) = this.fut { let mut encoder = ready!(Pin::new(fut).poll(cx)) .map_err(|_| { - EncoderError::Io(io::Error::new( - io::ErrorKind::Other, + EncoderError::Io(io::Error::other( "Blocking task was cancelled unexpectedly", )) })? diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index 8ef2698a2..e4d640518 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -415,7 +415,7 @@ mod tests { #[test] fn test_as_response() { - let orig = io::Error::new(io::ErrorKind::Other, "other"); + let orig = io::Error::other("other"); let err: Error = ParseError::Io(orig).into(); assert_eq!( format!("{}", err), @@ -425,14 +425,14 @@ mod tests { #[test] fn test_error_display() { - let orig = io::Error::new(io::ErrorKind::Other, "other"); + let orig = io::Error::other("other"); let err = Error::new_io().with_cause(orig); assert_eq!("connection error: other", err.to_string()); } #[test] fn test_error_http_response() { - let orig = io::Error::new(io::ErrorKind::Other, "other"); + let orig = io::Error::other("other"); let err = Error::new_io().with_cause(orig); let resp: Response = err.into(); assert_eq!(resp.status(), StatusCode::INTERNAL_SERVER_ERROR); @@ -440,7 +440,7 @@ mod tests { #[test] fn test_payload_error() { - let err: PayloadError = io::Error::new(io::ErrorKind::Other, "ParseError").into(); + let err: PayloadError = io::Error::other("ParseError").into(); assert!(err.to_string().contains("ParseError")); let err = PayloadError::Incomplete(None); @@ -475,7 +475,7 @@ mod tests { #[test] fn test_from() { - from_and_cause!(io::Error::new(io::ErrorKind::Other, "other") => ParseError::Io(..)); + from_and_cause!(io::Error::other("other") => ParseError::Io(..)); from!(httparse::Error::HeaderName => ParseError::Header); from!(httparse::Error::HeaderName => ParseError::Header); from!(httparse::Error::HeaderValue => ParseError::Header); diff --git a/actix-http/src/h1/encoder.rs b/actix-http/src/h1/encoder.rs index 77e34bcdc..81af7868b 100644 --- a/actix-http/src/h1/encoder.rs +++ b/actix-http/src/h1/encoder.rs @@ -310,10 +310,10 @@ impl MessageType for RequestHeadType { Version::HTTP_11 => "HTTP/1.1", Version::HTTP_2 => "HTTP/2.0", Version::HTTP_3 => "HTTP/3.0", - _ => return Err(io::Error::new(io::ErrorKind::Other, "unsupported version")), + _ => return Err(io::Error::other("Unsupported version")), } ) - .map_err(|err| io::Error::new(io::ErrorKind::Other, err)) + .map_err(io::Error::other) } } @@ -433,7 +433,7 @@ impl TransferEncoding { buf.extend_from_slice(b"0\r\n\r\n"); } else { writeln!(helpers::MutWriter(buf), "{:X}\r", msg.len()) - .map_err(|err| io::Error::new(io::ErrorKind::Other, err))?; + .map_err(io::Error::other)?; buf.reserve(msg.len() + 2); buf.extend_from_slice(msg); diff --git a/actix-web-actors/src/ws.rs b/actix-web-actors/src/ws.rs index 0002f87e2..22618c9b3 100644 --- a/actix-web-actors/src/ws.rs +++ b/actix-web-actors/src/ws.rs @@ -776,10 +776,7 @@ where } Poll::Pending => break, Poll::Ready(Some(Err(err))) => { - return Poll::Ready(Some(Err(ProtocolError::Io(io::Error::new( - io::ErrorKind::Other, - format!("{err}"), - ))))); + return Poll::Ready(Some(Err(ProtocolError::Io(io::Error::other(err))))); } } } @@ -795,11 +792,10 @@ where } Some(frm) => { let msg = match frm { - Frame::Text(data) => { - Message::Text(ByteString::try_from(data).map_err(|err| { - ProtocolError::Io(io::Error::new(io::ErrorKind::Other, err)) - })?) - } + Frame::Text(data) => Message::Text( + ByteString::try_from(data) + .map_err(|err| ProtocolError::Io(io::Error::other(err)))?, + ), Frame::Binary(data) => Message::Binary(data), Frame::Ping(s) => Message::Ping(s), Frame::Pong(s) => Message::Pong(s), diff --git a/actix-web/src/server.rs b/actix-web/src/server.rs index 1ea4de4ca..ef6d26f94 100644 --- a/actix-web/src/server.rs +++ b/actix-web/src/server.rs @@ -1073,10 +1073,7 @@ fn bind_addrs(addrs: impl net::ToSocketAddrs, backlog: u32) -> io::Result Date: Fri, 9 May 2025 20:32:05 +0100 Subject: [PATCH 07/14] build(deps): bump tokio-util from 0.7.14 to 0.7.15 (#3631) Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.7.14 to 0.7.15. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.14...tokio-util-0.7.15) --- updated-dependencies: - dependency-name: tokio-util dependency-version: 0.7.15 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96cd56efb..a5e13f6b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3210,9 +3210,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", From 6892896a62943daa2c6a689d4f45fa3dcae0badc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 20:32:17 +0100 Subject: [PATCH 08/14] build(deps): bump actions-rust-lang/setup-rust-toolchain from 1.11.0 to 1.12.0 (#3632) build(deps): bump actions-rust-lang/setup-rust-toolchain Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.11.0 to 1.12.0. - [Release notes](https://github.com/actions-rust-lang/setup-rust-toolchain/releases) - [Changelog](https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.11.0...v1.12.0) --- updated-dependencies: - dependency-name: actions-rust-lang/setup-rust-toolchain dependency-version: 1.12.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 6 +++--- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 72cffbdc3..e551f8a7a 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -44,7 +44,7 @@ jobs: echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV - name: Install Rust (${{ matrix.version.name }}) - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: toolchain: ${{ matrix.version.version }} @@ -80,7 +80,7 @@ jobs: uses: rui314/setup-mold@v1 - name: Install Rust - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 - name: Install just, cargo-hack uses: taiki-e/install-action@v2.49.50 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c2ecdeea..efd1cb9a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: uses: rui314/setup-mold@v1 - name: Install Rust (${{ matrix.version.name }}) - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: toolchain: ${{ matrix.version.version }} @@ -92,7 +92,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: toolchain: nightly @@ -108,7 +108,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: toolchain: nightly diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2d2aa1c5e..fa5e9bf10 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: toolchain: nightly components: llvm-tools diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b1e34a57e..bb230afec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: toolchain: nightly components: rustfmt @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: components: clippy @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust (nightly) - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: toolchain: nightly components: rust-docs @@ -72,7 +72,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }}) - uses: actions-rust-lang/setup-rust-toolchain@v1.11.0 + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 with: toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} From 9829f87cd1971b7532c063741ff4decb4e4e46b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 20:32:24 +0100 Subject: [PATCH 09/14] build(deps): bump taiki-e/install-action from 2.49.50 to 2.50.7 (#3636) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.49.50 to 2.50.7. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.49.50...v2.50.7) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.50.7 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index e551f8a7a..0d0614458 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.49.50 + uses: taiki-e/install-action@v2.50.7 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.49.50 + uses: taiki-e/install-action@v2.50.7 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efd1cb9a9..614b26386 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.49.50 + uses: taiki-e/install-action@v2.50.7 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.49.50 + uses: taiki-e/install-action@v2.50.7 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fa5e9bf10..144b4a336 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.49.50 + uses: taiki-e/install-action@v2.50.7 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bb230afec..9f5ec1a99 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - name: Install just - uses: taiki-e/install-action@v2.49.50 + uses: taiki-e/install-action@v2.50.7 with: tool: just From 2dd165dc0b275c33530b16425aa87d59c83c53e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 20:05:19 +0000 Subject: [PATCH 10/14] build(deps): bump divan from 0.1.18 to 0.1.21 (#3621) Bumps [divan](https://github.com/nvzqz/divan) from 0.1.18 to 0.1.21. - [Changelog](https://github.com/nvzqz/divan/blob/main/CHANGELOG.md) - [Commits](https://github.com/nvzqz/divan/compare/v0.1.18...v0.1.21) --- updated-dependencies: - dependency-name: divan dependency-version: 0.1.21 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .cspell.yml | 1 + .github/dependabot.yml | 9 +++++---- Cargo.lock | 8 ++++---- justfile | 3 ++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.cspell.yml b/.cspell.yml index 813349383..5278c478d 100644 --- a/.cspell.yml +++ b/.cspell.yml @@ -2,4 +2,5 @@ version: "0.2" words: - actix - httparse + - msrv - rustup diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c7ecf5eaa..3aeae6b1b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,11 @@ version: 2 updates: - - package-ecosystem: cargo - directory: / - schedule: - interval: weekly - package-ecosystem: github-actions directory: / schedule: interval: weekly + - package-ecosystem: cargo + directory: / + schedule: + interval: weekly + versioning-strategy: lockfile-only diff --git a/Cargo.lock b/Cargo.lock index a5e13f6b6..92ed4e6b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1211,9 +1211,9 @@ dependencies = [ [[package]] name = "divan" -version = "0.1.18" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009c56317fe2bd3b5eebe3aa888828c62ed1b085d26c1ef2079a60369795765e" +checksum = "a405457ec78b8fe08b0e32b4a3570ab5dff6dd16eb9e76a5ee0a9d9cbd898933" dependencies = [ "cfg-if", "clap", @@ -1225,9 +1225,9 @@ dependencies = [ [[package]] name = "divan-macros" -version = "0.1.18" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4de9827ae754db91aedec0277381f5a2d8e2f801564c8d774acfe1ab1b045e" +checksum = "9556bc800956545d6420a640173e5ba7dfa82f38d3ea5a167eb555bc69ac3323" dependencies = [ "proc-macro2", "quote", diff --git a/justfile b/justfile index 9d3ad5e31..a9df2d633 100644 --- a/justfile +++ b/justfile @@ -49,7 +49,8 @@ clippy: cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }} # Test workspace using MSRV. -test-msrv: downgrade-for-msrv +test-msrv: + @just toolchain={{ msrv_rustup }} downgrade-for-msrv @just toolchain={{ msrv_rustup }} test # Test workspace code. From bbe01345238168ba14b4752173f7e57543891765 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 20:05:56 +0000 Subject: [PATCH 11/14] build(deps): bump brotli from 7.0.0 to 8.0.0 (#3627) * build(deps): bump brotli from 7.0.0 to 8.0.0 Bumps [brotli](https://github.com/dropbox/rust-brotli) from 7.0.0 to 8.0.0. - [Release notes](https://github.com/dropbox/rust-brotli/releases) - [Commits](https://github.com/dropbox/rust-brotli/commits) --- updated-dependencies: - dependency-name: brotli dependency-version: 8.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * docs: update changelog --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rob Ede --- Cargo.lock | 8 ++++---- actix-http/CHANGES.md | 2 ++ actix-http/Cargo.toml | 2 +- actix-web/CHANGES.md | 2 ++ actix-web/Cargo.toml | 2 +- awc/CHANGES.md | 2 ++ awc/Cargo.toml | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 92ed4e6b4..efa8b84f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -762,9 +762,9 @@ dependencies = [ [[package]] name = "brotli" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +checksum = "cf19e729cdbd51af9a397fb9ef8ac8378007b797f8273cfbfdf45dcaa316167b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -773,9 +773,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.2" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" +checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 7324cba5a..1e1d464c8 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +- Update `brotli` dependency to `8`. + ## 3.10.0 ### Added diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index 0e5c4b234..f3b8c5cbe 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -139,7 +139,7 @@ sha1 = { version = "0.10", optional = true } actix-tls = { version = "3.4", default-features = false, optional = true } # compress-* -brotli = { version = "7", optional = true } +brotli = { version = "8", optional = true } flate2 = { version = "1.0.13", optional = true } zstd = { version = "0.13", optional = true } diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 394a8c934..091a9d8c1 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +- Update `brotli` dependency to `8`. + ## 4.10.2 - No significant changes since `4.10.1`. diff --git a/actix-web/Cargo.toml b/actix-web/Cargo.toml index 29c6970e6..93e084146 100644 --- a/actix-web/Cargo.toml +++ b/actix-web/Cargo.toml @@ -173,7 +173,7 @@ actix-files = "0.6" actix-test = { version = "0.1", features = ["openssl", "rustls-0_23"] } awc = { version = "3", features = ["openssl"] } -brotli = "7" +brotli = "8" const-str = "0.5" core_affinity = "0.8" criterion = { version = "0.5", features = ["html_reports"] } diff --git a/awc/CHANGES.md b/awc/CHANGES.md index d3fd7147b..89458041b 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +- Update `brotli` dependency to `8`. + ## 3.6.0 - Prevent panics on connection pool drop when Tokio runtime is shutdown early. diff --git a/awc/Cargo.toml b/awc/Cargo.toml index 106def621..37a089c4c 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -141,7 +141,7 @@ actix-tls = { version = "3.4", features = ["openssl", "rustls-0_23"] } actix-utils = "3" actix-web = { version = "4", features = ["openssl"] } -brotli = "7" +brotli = "8" const-str = "0.5" env_logger = "0.11" flate2 = "1.0.13" From e983276a780fdd4ba4abc028b37bff8c1e038bc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 20:40:46 +0000 Subject: [PATCH 12/14] build(deps): bump taiki-e/install-action from 2.50.7 to 2.50.10 (#3641) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.50.7 to 2.50.10. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.50.7...v2.50.10) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.50.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 0d0614458..c6f56e67a 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.50.7 + uses: taiki-e/install-action@v2.50.10 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.50.7 + uses: taiki-e/install-action@v2.50.10 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 614b26386..a1adf6b41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.50.7 + uses: taiki-e/install-action@v2.50.10 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.50.7 + uses: taiki-e/install-action@v2.50.10 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 144b4a336..6500c0adb 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.50.7 + uses: taiki-e/install-action@v2.50.10 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9f5ec1a99..dfddd25cd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - name: Install just - uses: taiki-e/install-action@v2.50.7 + uses: taiki-e/install-action@v2.50.10 with: tool: just From f1b7cfb2533a081476cfc5a731112bbf8c457e64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 20:43:47 +0000 Subject: [PATCH 13/14] build(deps): bump tokio from 1.44.2 to 1.45.0 (#3643) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.2 to 1.45.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.2...tokio-1.45.0) --- updated-dependencies: - dependency-name: tokio dependency-version: 1.45.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index efa8b84f4..da52f2bce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3102,9 +3102,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.2" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" +checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" dependencies = [ "backtrace", "bytes", From 6e902d1d5cc4739ab32fb8bdab02628c0e39c9e2 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 10 May 2025 00:16:21 +0100 Subject: [PATCH 14/14] feat: add HttpServer::shutdown_signal (#3644) --- .cspell.yml | 2 ++ Cargo.lock | 5 +++-- actix-web/CHANGES.md | 2 ++ actix-web/Cargo.toml | 3 ++- actix-web/src/server.rs | 36 +++++++++++++++++++++++++++++++++++- 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/.cspell.yml b/.cspell.yml index 5278c478d..f275e0a24 100644 --- a/.cspell.yml +++ b/.cspell.yml @@ -1,6 +1,8 @@ version: "0.2" words: - actix + - addrs - httparse - msrv - rustup + - zstd diff --git a/Cargo.lock b/Cargo.lock index da52f2bce..29df16251 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -251,9 +251,9 @@ dependencies = [ [[package]] name = "actix-server" -version = "2.5.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6398974fd4284f4768af07965701efbbb5fdc0616bff20cade1bb14b77675e24" +checksum = "a65064ea4a457eaf07f2fba30b4c695bf43b721790e9530d26cb6f9019ff7502" dependencies = [ "actix-rt", "actix-service", @@ -397,6 +397,7 @@ dependencies = [ "static_assertions", "time", "tokio", + "tokio-util", "tracing", "url", "zstd", diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 091a9d8c1..01d2694c8 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +- Add `HttpServer::shutdown_signal()` method. +- Mark `HttpServer` as `#[must_use]`. - Update `brotli` dependency to `8`. ## 4.10.2 diff --git a/actix-web/Cargo.toml b/actix-web/Cargo.toml index 93e084146..afa4eadbc 100644 --- a/actix-web/Cargo.toml +++ b/actix-web/Cargo.toml @@ -132,7 +132,7 @@ compat-routing-macros-force-pub = ["actix-web-codegen?/compat-routing-macros-for actix-codec = "0.5" actix-macros = { version = "0.2.3", optional = true } actix-rt = { version = "2.6", default-features = false } -actix-server = "2" +actix-server = "2.6" actix-service = "2" actix-utils = "3" actix-tls = { version = "3.4", default-features = false, optional = true } @@ -188,6 +188,7 @@ static_assertions = "1" tls-openssl = { package = "openssl", version = "0.10.55" } tls-rustls = { package = "rustls", version = "0.23" } tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] } +tokio-util = "0.7" zstd = "0.13" [lints] diff --git a/actix-web/src/server.rs b/actix-web/src/server.rs index ef6d26f94..d56bbe84c 100644 --- a/actix-web/src/server.rs +++ b/actix-web/src/server.rs @@ -1,6 +1,8 @@ use std::{ any::Any, - cmp, fmt, io, + cmp, fmt, + future::Future, + io, marker::PhantomData, net, sync::{Arc, Mutex}, @@ -64,6 +66,7 @@ struct Config { /// .await /// } /// ``` +#[must_use] pub struct HttpServer where F: Fn() -> I + Send + Clone + 'static, @@ -312,6 +315,37 @@ where self } + /// Specify shutdown signal from a future. + /// + /// Using this method will prevent OS signal handlers being set up. + /// + /// Typically, a `CancellationToken` will be used, but any future _can_ be. + /// + /// # Examples + /// + /// ```no_run + /// use actix_web::{App, HttpServer}; + /// use tokio_util::sync::CancellationToken; + /// + /// # #[actix_web::main] + /// # async fn main() -> std::io::Result<()> { + /// let stop_signal = CancellationToken::new(); + /// + /// HttpServer::new(move || App::new()) + /// .shutdown_signal(stop_signal.cancelled_owned()) + /// .bind(("127.0.0.1", 8080))? + /// .run() + /// .await + /// # } + /// ``` + pub fn shutdown_signal(mut self, shutdown_signal: Fut) -> Self + where + Fut: Future + Send + 'static, + { + self.builder = self.builder.shutdown_signal(shutdown_signal); + self + } + /// Sets timeout for graceful worker shutdown of workers. /// /// After receiving a stop signal, workers have this much time to finish serving requests.