mirror of https://github.com/fafhrd91/actix-web
Compare commits
No commits in common. "1c4e265a708b7ed600d96c8e03f3ac0e5b801502" and "48aaf41638e86ef932a4003c8153d714f30d47bd" have entirely different histories.
1c4e265a70
...
48aaf41638
|
@ -44,12 +44,12 @@ jobs:
|
||||||
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Install Rust (${{ matrix.version.name }})
|
- name: Install Rust (${{ matrix.version.name }})
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.version.version }}
|
toolchain: ${{ matrix.version.version }}
|
||||||
|
|
||||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||||
uses: taiki-e/install-action@v2.44.15
|
uses: taiki-e/install-action@v2.43.1
|
||||||
with:
|
with:
|
||||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||||
|
|
||||||
|
@ -80,10 +80,10 @@ jobs:
|
||||||
uses: rui314/setup-mold@v1
|
uses: rui314/setup-mold@v1
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
|
|
||||||
- name: Install just, cargo-hack
|
- name: Install just, cargo-hack
|
||||||
uses: taiki-e/install-action@v2.44.15
|
uses: taiki-e/install-action@v2.43.1
|
||||||
with:
|
with:
|
||||||
tool: just,cargo-hack
|
tool: just,cargo-hack
|
||||||
|
|
||||||
|
|
|
@ -59,12 +59,12 @@ jobs:
|
||||||
uses: rui314/setup-mold@v1
|
uses: rui314/setup-mold@v1
|
||||||
|
|
||||||
- name: Install Rust (${{ matrix.version.name }})
|
- name: Install Rust (${{ matrix.version.name }})
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.version.version }}
|
toolchain: ${{ matrix.version.version }}
|
||||||
|
|
||||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||||
uses: taiki-e/install-action@v2.44.15
|
uses: taiki-e/install-action@v2.43.1
|
||||||
with:
|
with:
|
||||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
|
|
||||||
|
@ -108,12 +108,12 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly)
|
- name: Install Rust (nightly)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
|
|
||||||
- name: Install just
|
- name: Install just
|
||||||
uses: taiki-e/install-action@v2.44.15
|
uses: taiki-e/install-action@v2.43.1
|
||||||
with:
|
with:
|
||||||
tool: just
|
tool: just
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,13 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly)
|
- name: Install Rust (nightly)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: llvm-tools
|
components: llvm-tools
|
||||||
|
|
||||||
- name: Install just, cargo-llvm-cov, cargo-nextest
|
- name: Install just, cargo-llvm-cov, cargo-nextest
|
||||||
uses: taiki-e/install-action@v2.44.15
|
uses: taiki-e/install-action@v2.43.1
|
||||||
with:
|
with:
|
||||||
tool: just,cargo-llvm-cov,cargo-nextest
|
tool: just,cargo-llvm-cov,cargo-nextest
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly)
|
- name: Install Rust (nightly)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
|
@ -36,7 +36,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
components: clippy
|
components: clippy
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly)
|
- name: Install Rust (nightly)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: rust-docs
|
components: rust-docs
|
||||||
|
@ -66,18 +66,17 @@ jobs:
|
||||||
run: cargo +nightly doc --no-deps --workspace --all-features
|
run: cargo +nightly doc --no-deps --workspace --all-features
|
||||||
|
|
||||||
check-external-types:
|
check-external-types:
|
||||||
if: false # disable until https://github.com/awslabs/cargo-check-external-types/pull/177 is marged
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly-2024-05-01)
|
- name: Install Rust (nightly-2024-05-01)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly-2024-05-01
|
toolchain: nightly-2024-05-01
|
||||||
|
|
||||||
- name: Install just
|
- name: Install just
|
||||||
uses: taiki-e/install-action@v2.44.15
|
uses: taiki-e/install-action@v2.43.1
|
||||||
with:
|
with:
|
||||||
tool: just
|
tool: just
|
||||||
|
|
||||||
|
@ -100,13 +99,13 @@ jobs:
|
||||||
- name: Checkout PR branch
|
- name: Checkout PR branch
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust (nightly-2024-09-30)
|
- name: Install Rust (nightly-2024-06-07)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly-2024-09-30
|
toolchain: nightly-2024-06-07
|
||||||
|
|
||||||
- name: Install cargo-public-api
|
- name: Install cargo-public-api
|
||||||
uses: taiki-e/install-action@v2.44.15
|
uses: taiki-e/install-action@v2.43.1
|
||||||
with:
|
with:
|
||||||
tool: cargo-public-api
|
tool: cargo-public-api
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||||
- On Windows platforms, produce an error when invoking `HttpServer::bind` on a socket that's already in use. See [issue 2958](https://github.com/actix/actix-web/issues/2958).
|
|
||||||
|
|
||||||
## 4.9.0
|
## 4.9.0
|
||||||
|
|
||||||
|
|
|
@ -1085,10 +1085,7 @@ fn create_tcp_listener(addr: net::SocketAddr, backlog: u32) -> io::Result<net::T
|
||||||
use socket2::{Domain, Protocol, Socket, Type};
|
use socket2::{Domain, Protocol, Socket, Type};
|
||||||
let domain = Domain::for_address(addr);
|
let domain = Domain::for_address(addr);
|
||||||
let socket = Socket::new(domain, Type::STREAM, Some(Protocol::TCP))?;
|
let socket = Socket::new(domain, Type::STREAM, Some(Protocol::TCP))?;
|
||||||
#[cfg(not(windows))]
|
socket.set_reuse_address(true)?;
|
||||||
{
|
|
||||||
socket.set_reuse_address(true)?;
|
|
||||||
}
|
|
||||||
socket.bind(&addr.into())?;
|
socket.bind(&addr.into())?;
|
||||||
// clamp backlog to max u32 that fits in i32 range
|
// clamp backlog to max u32 that fits in i32 range
|
||||||
let backlog = cmp::min(backlog, i32::MAX as u32) as i32;
|
let backlog = cmp::min(backlog, i32::MAX as u32) as i32;
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
#[cfg(feature = "openssl")]
|
#[cfg(feature = "openssl")]
|
||||||
extern crate tls_openssl as openssl;
|
extern crate tls_openssl as openssl;
|
||||||
|
|
||||||
use std::{sync::mpsc, thread, time::Duration};
|
#[cfg(any(unix, feature = "openssl"))]
|
||||||
|
use {
|
||||||
use actix_web::{web, App, HttpResponse, HttpServer};
|
actix_web::{web, App, HttpResponse, HttpServer},
|
||||||
|
std::{sync::mpsc, thread, time::Duration},
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_start() {
|
async fn test_start() {
|
||||||
let addr = actix_test::unused_addr();
|
let addr = actix_test::unused_addr();
|
||||||
|
@ -50,27 +53,6 @@ async fn test_start() {
|
||||||
let response = client.get(host.clone()).send().await.unwrap();
|
let response = client.get(host.clone()).send().await.unwrap();
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
|
|
||||||
// Attempt to start a second server using the same address.
|
|
||||||
let result = HttpServer::new(|| {
|
|
||||||
App::new().service(
|
|
||||||
web::resource("/").route(web::to(|| async { HttpResponse::Ok().body("test") })),
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.workers(1)
|
|
||||||
.backlog(1)
|
|
||||||
.max_connections(10)
|
|
||||||
.max_connection_rate(10)
|
|
||||||
.keep_alive(Duration::from_secs(10))
|
|
||||||
.client_request_timeout(Duration::from_secs(5))
|
|
||||||
.client_disconnect_timeout(Duration::ZERO)
|
|
||||||
.server_hostname("localhost")
|
|
||||||
.system_exit()
|
|
||||||
.disable_signals()
|
|
||||||
.bind(format!("{}", addr));
|
|
||||||
|
|
||||||
// This should fail: the address is in use.
|
|
||||||
assert!(result.is_err());
|
|
||||||
|
|
||||||
srv.stop(false).await;
|
srv.stop(false).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
justfile
1
justfile
|
@ -10,7 +10,6 @@ fmt:
|
||||||
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
|
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
|
||||||
[private]
|
[private]
|
||||||
downgrade-for-msrv:
|
downgrade-for-msrv:
|
||||||
cargo update -p=parse-size --precise=1.0.0
|
|
||||||
cargo update -p=clap --precise=4.4.18
|
cargo update -p=clap --precise=4.4.18
|
||||||
|
|
||||||
msrv := ```
|
msrv := ```
|
||||||
|
|
Loading…
Reference in New Issue