mirror of
https://github.com/fafhrd91/actix-net
synced 2025-08-18 04:35:32 +02:00
Compare commits
9 Commits
bytestring
...
server-v2.
Author | SHA1 | Date | |
---|---|---|---|
|
d13461b337 | ||
|
dde38bbe06 | ||
|
d973d5974a | ||
|
d7afd60606 | ||
|
7e47bf4055 | ||
|
05e7be337e | ||
|
8d964713c9 | ||
|
fe38312db0 | ||
|
2b83f08a40 |
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
- { name: Windows (MinGW), os: windows-latest, triple: x86_64-pc-windows-gnu }
|
||||
- { name: Windows (32-bit), os: windows-latest, triple: i686-pc-windows-msvc }
|
||||
version:
|
||||
- 1.57.0
|
||||
- 1.59.0
|
||||
- stable
|
||||
|
||||
name: ${{ matrix.target.name }} / ${{ matrix.version }}
|
||||
@@ -68,10 +68,20 @@ jobs:
|
||||
# uses: Swatinem/rust-cache@v1.2.0
|
||||
|
||||
- name: Install cargo-hack
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: install
|
||||
args: cargo-hack
|
||||
if: matrix.version != '1.59.0'
|
||||
run: cargo install cargo-hack
|
||||
|
||||
# newer cargo-hack versions require 1.60 or above
|
||||
- name: Install cargo-hack (1.59.0)
|
||||
if: matrix.version == '1.59.0'
|
||||
run: cargo install cargo-hack --version=0.5.21
|
||||
|
||||
- name: workaround MSRV issues
|
||||
if: matrix.version == '1.59.0'
|
||||
run: |
|
||||
cargo install cargo-edit --version=0.8.0
|
||||
cargo add env_logger@0.9 --dev -p=actix-tls
|
||||
cargo add env_logger@0.9 --dev -p=actix-server
|
||||
|
||||
- name: Generate Cargo.lock
|
||||
uses: actions-rs/cargo@v1
|
||||
@@ -123,7 +133,7 @@ jobs:
|
||||
sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && PATH=$PATH:/usr/share/rust/.cargo/bin && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-linux"
|
||||
|
||||
- name: Clear the cargo caches
|
||||
if: matrix.version == 'stable' # MSRV(1.58) cargo-cache now fails to install on 1.57
|
||||
if: matrix.version == 'stable' # MSRV(1.58) cargo-cache now fails to install on 1.59
|
||||
run: |
|
||||
cargo install cargo-cache --version 0.6.2 --no-default-features --features ci-autoclean
|
||||
cargo-cache
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 0.5.1 - 2022-03-15
|
||||
|
@@ -23,7 +23,7 @@ futures-core = { version = "0.3.7", default-features = false }
|
||||
futures-sink = { version = "0.3.7", default-features = false }
|
||||
memchr = "2.3"
|
||||
pin-project-lite = "0.2"
|
||||
tokio = "1.13.1"
|
||||
tokio = "1.18.4"
|
||||
tokio-util = { version = "0.7", features = ["codec", "io"] }
|
||||
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 0.2.3 - 2021-10-19
|
||||
|
@@ -16,12 +16,12 @@ edition = "2018"
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
quote = "1.0.3"
|
||||
syn = { version = "^1", features = ["full"] }
|
||||
quote = "1"
|
||||
syn = { version = "1", features = ["full"] }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "2.0.0"
|
||||
actix-rt = "2"
|
||||
|
||||
futures-util = { version = "0.3.7", default-features = false }
|
||||
futures-util = { version = "0.3.17", default-features = false }
|
||||
rustversion = "1"
|
||||
trybuild = "1"
|
||||
|
@@ -1,21 +1,26 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
|
||||
|
||||
## 2.8.0 - 2022-12-21
|
||||
- Add `#[track_caller]` attribute to `spawn` functions and methods. [#454]
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
- Update `tokio-uring` dependency to `0.4`. [#473]
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
[#454]: https://github.com/actix/actix-net/pull/454
|
||||
[#473]: https://github.com/actix/actix-net/pull/473
|
||||
|
||||
|
||||
## 2.7.0 - 2022-03-08
|
||||
- Update `tokio-uring` dependency to `0.3.0`. [#448]
|
||||
- Update `tokio-uring` dependency to `0.3`. [#448]
|
||||
- Minimum supported Rust version (MSRV) is now 1.49.
|
||||
|
||||
[#448]: https://github.com/actix/actix-net/pull/448
|
||||
|
||||
|
||||
## 2.6.0 - 2022-01-12
|
||||
- Update `tokio-uring` dependency to `0.2.0`. [#436]
|
||||
- Update `tokio-uring` dependency to `0.2`. [#436]
|
||||
|
||||
[#436]: https://github.com/actix/actix-net/pull/436
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-rt"
|
||||
version = "2.7.0"
|
||||
version = "2.8.0"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
@@ -26,12 +26,12 @@ io-uring = ["tokio-uring"]
|
||||
actix-macros = { version = "0.2.3", optional = true }
|
||||
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
tokio = { version = "1.13.1", features = ["rt", "net", "parking_lot", "signal", "sync", "time"] }
|
||||
tokio = { version = "1.18.4", features = ["rt", "net", "parking_lot", "signal", "sync", "time"] }
|
||||
|
||||
# runtime for `io-uring` feature
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
tokio-uring = { version = "0.3", optional = true }
|
||||
tokio-uring = { version = "0.4", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.13.1", features = ["full"] }
|
||||
tokio = { version = "1.18.4", features = ["full"] }
|
||||
hyper = { version = "0.14.10", default-features = false, features = ["server", "tcp", "http1"] }
|
||||
|
@@ -3,11 +3,11 @@
|
||||
> Tokio-based single-threaded async runtime for the Actix ecosystem.
|
||||
|
||||
[](https://crates.io/crates/actix-rt)
|
||||
[](https://docs.rs/actix-rt/2.7.0)
|
||||
[](https://docs.rs/actix-rt/2.8.0)
|
||||
[](https://blog.rust-lang.org/2020/03/12/Rust-1.46.html)
|
||||

|
||||
<br />
|
||||
[](https://deps.rs/crate/actix-rt/2.7.0)
|
||||
[](https://deps.rs/crate/actix-rt/2.8.0)
|
||||

|
||||
[](https://discord.gg/WghFtEH6Hb)
|
||||
|
||||
|
@@ -303,7 +303,7 @@ impl Future for ArbiterRunner {
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
// process all items currently buffered in channel
|
||||
loop {
|
||||
match ready!(Pin::new(&mut self.rx).poll_recv(cx)) {
|
||||
match ready!(self.rx.poll_recv(cx)) {
|
||||
// channel closed; no more messages can be received
|
||||
None => return Poll::Ready(()),
|
||||
|
||||
|
@@ -292,7 +292,7 @@ impl Future for SystemController {
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
// process all items currently buffered in channel
|
||||
loop {
|
||||
match ready!(Pin::new(&mut self.cmd_rx).poll_recv(cx)) {
|
||||
match ready!(self.cmd_rx.poll_recv(cx)) {
|
||||
// channel closed; no more messages can be received
|
||||
None => return Poll::Ready(()),
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
|
||||
|
||||
## 2.2.0 - 2022-12-21
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
- Update `tokio-uring` dependency to `0.4`. [#473]
|
||||
|
||||
[#473]: https://github.com/actix/actix-net/pull/473
|
||||
|
||||
|
||||
## 2.1.1 - 2022-03-09
|
||||
@@ -9,7 +15,7 @@
|
||||
|
||||
|
||||
## 2.1.0 - 2022-03-08
|
||||
- Update `tokio-uring` dependency to `0.3.0`. [#448]
|
||||
- Update `tokio-uring` dependency to `0.3`. [#448]
|
||||
- Logs emitted now use the `tracing` crate with `log` compatibility. [#448]
|
||||
- Wait for accept thread to stop before sending completion signal. [#443]
|
||||
|
||||
@@ -22,7 +28,7 @@
|
||||
|
||||
|
||||
## 2.0.0-rc.4 - 2022-01-12
|
||||
- Update `tokio-uring` dependency to `0.2.0`. [#436]
|
||||
- Update `tokio-uring` dependency to `0.2`. [#436]
|
||||
|
||||
[#436]: https://github.com/actix/actix-net/pull/436
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-server"
|
||||
version = "2.1.1"
|
||||
version = "2.2.0"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
@@ -23,27 +23,27 @@ default = []
|
||||
io-uring = ["tokio-uring", "actix-rt/io-uring"]
|
||||
|
||||
[dependencies]
|
||||
actix-rt = { version = "2.7", default-features = false }
|
||||
actix-rt = { version = "2.8", default-features = false }
|
||||
actix-service = "2"
|
||||
actix-utils = "3"
|
||||
|
||||
futures-core = { version = "0.3.7", default-features = false, features = ["alloc"] }
|
||||
futures-util = { version = "0.3.7", default-features = false, features = ["alloc"] }
|
||||
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||
mio = { version = "0.8", features = ["os-poll", "net"] }
|
||||
num_cpus = "1.13"
|
||||
socket2 = "0.4.2"
|
||||
tokio = { version = "1.13.1", features = ["sync"] }
|
||||
tokio = { version = "1.18.4", features = ["sync"] }
|
||||
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
||||
|
||||
# runtime for `io-uring` feature
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
tokio-uring = { version = "0.3", optional = true }
|
||||
tokio-uring = { version = "0.4", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-codec = "0.5"
|
||||
actix-rt = "2.6"
|
||||
actix-rt = "2.8"
|
||||
|
||||
bytes = "1"
|
||||
env_logger = "0.9"
|
||||
futures-util = { version = "0.3.7", default-features = false, features = ["sink", "async-await-macro"] }
|
||||
tokio = { version = "1.13.1", features = ["io-util", "rt-multi-thread", "macros", "fs"] }
|
||||
env_logger = "0.10"
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["sink", "async-await-macro"] }
|
||||
tokio = { version = "1.18.4", features = ["io-util", "rt-multi-thread", "macros", "fs"] }
|
||||
|
@@ -3,10 +3,10 @@
|
||||
> General purpose TCP server built for the Actix ecosystem.
|
||||
|
||||
[](https://crates.io/crates/actix-server)
|
||||
[](https://docs.rs/actix-server/2.1.1)
|
||||
[](https://docs.rs/actix-server/2.2.0)
|
||||
[](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
|
||||

|
||||
[](https://deps.rs/crate/actix-server/2.1.1)
|
||||
[](https://deps.rs/crate/actix-server/2.2.0)
|
||||

|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
|
@@ -363,6 +363,6 @@ impl Stream for ServerEventMultiplexer {
|
||||
}
|
||||
}
|
||||
|
||||
Pin::new(&mut this.cmd_rx).poll_recv(cx)
|
||||
this.cmd_rx.poll_recv(cx)
|
||||
}
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ impl Future for Signals {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
for (sig, fut) in self.signals.iter_mut() {
|
||||
if Pin::new(fut).poll_recv(cx).is_ready() {
|
||||
if fut.poll_recv(cx).is_ready() {
|
||||
trace!("{} received", sig);
|
||||
return Poll::Ready(*sig);
|
||||
}
|
||||
|
@@ -585,9 +585,7 @@ impl Future for ServerWorker {
|
||||
let this = self.as_mut().get_mut();
|
||||
|
||||
// `StopWorker` message handler
|
||||
if let Poll::Ready(Some(Stop { graceful, tx })) =
|
||||
Pin::new(&mut this.stop_rx).poll_recv(cx)
|
||||
{
|
||||
if let Poll::Ready(Some(Stop { graceful, tx })) = this.stop_rx.poll_recv(cx) {
|
||||
let num = this.counter.total();
|
||||
if num == 0 {
|
||||
info!("shutting down idle worker");
|
||||
@@ -649,7 +647,7 @@ impl Future for ServerWorker {
|
||||
}
|
||||
WorkerState::Shutdown(ref mut shutdown) => {
|
||||
// drop all pending connections in rx channel.
|
||||
while let Poll::Ready(Some(conn)) = Pin::new(&mut this.conn_rx).poll_recv(cx) {
|
||||
while let Poll::Ready(Some(conn)) = this.conn_rx.poll_recv(cx) {
|
||||
// WorkerCounterGuard is needed as Accept thread has incremented counter.
|
||||
// It's guard's job to decrement the counter together with drop of Conn.
|
||||
let guard = this.counter.guard();
|
||||
@@ -696,7 +694,7 @@ impl Future for ServerWorker {
|
||||
}
|
||||
|
||||
// handle incoming io stream
|
||||
match ready!(Pin::new(&mut this.conn_rx).poll_recv(cx)) {
|
||||
match ready!(this.conn_rx.poll_recv(cx)) {
|
||||
Some(msg) => {
|
||||
let guard = this.counter.guard();
|
||||
let _ = this.services[msg.token].service.call((guard, msg.io));
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 2.0.2 - 2021-12-18
|
||||
|
@@ -17,11 +17,11 @@ name = "actix_service"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3.7", default-features = false }
|
||||
futures-core = { version = "0.3.17", default-features = false }
|
||||
paste = "1"
|
||||
pin-project-lite = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "2"
|
||||
actix-utils = "3"
|
||||
futures-util = { version = "0.3.7", default-features = false }
|
||||
futures-util = { version = "0.3.17", default-features = false }
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 3.0.4 - 2022-03-15
|
||||
|
@@ -49,7 +49,7 @@ actix-utils = "3"
|
||||
futures-core = { version = "0.3.7", default-features = false, features = ["alloc"] }
|
||||
impl-more = "0.1"
|
||||
pin-project-lite = "0.2.7"
|
||||
tokio = "1.13.1"
|
||||
tokio = "1.18.4"
|
||||
tokio-util = "0.7"
|
||||
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
||||
|
||||
@@ -72,8 +72,8 @@ actix-codec = "0.5"
|
||||
actix-rt = "2.2"
|
||||
actix-server = "2"
|
||||
bytes = "1"
|
||||
env_logger = "0.9"
|
||||
futures-util = { version = "0.3.7", default-features = false, features = ["sink"] }
|
||||
env_logger = "0.10"
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["sink"] }
|
||||
log = "0.4"
|
||||
rcgen = "0.10"
|
||||
rustls-pemfile = "1"
|
||||
|
@@ -41,8 +41,7 @@ use tracing::info;
|
||||
|
||||
#[actix_rt::main]
|
||||
async fn main() -> io::Result<()> {
|
||||
env::set_var("RUST_LOG", "info");
|
||||
env_logger::init();
|
||||
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));
|
||||
|
||||
// Load TLS key and cert files
|
||||
let cert_file = &mut BufReader::new(File::open("./examples/cert.pem").unwrap());
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 0.1.0 - 2020-01-15
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 3.0.1 - 2022-10-21
|
||||
|
@@ -21,6 +21,6 @@ pin-project-lite = "0.2"
|
||||
local-waker = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "2.0.0"
|
||||
futures-util = { version = "0.3.7", default-features = false }
|
||||
actix-rt = "2"
|
||||
futures-util = { version = "0.3.17", default-features = false }
|
||||
static_assertions = "1.1"
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 1.2.1 - 2022-11-12
|
||||
|
@@ -1 +1 @@
|
||||
msrv = "1.57"
|
||||
msrv = "1.59"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 0.1.3 - 2022-05-03
|
||||
|
@@ -12,10 +12,10 @@ license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3.7", default-features = false }
|
||||
futures-sink = { version = "0.3.7", default-features = false }
|
||||
futures-util = { version = "0.3.7", default-features = false }
|
||||
futures-core = "0.3.17"
|
||||
futures-sink = "0.3.17"
|
||||
futures-util = { version = "0.3.17", default-features = false }
|
||||
local-waker = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.13.1", features = ["rt", "macros"] }
|
||||
tokio = { version = "1.18.4", features = ["rt", "macros"] }
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57.
|
||||
- Minimum supported Rust version (MSRV) is now 1.59.
|
||||
|
||||
|
||||
## 0.1.3 - 2022-05-03
|
||||
|
@@ -6,8 +6,8 @@ authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
keywords = ["waker", "local", "futures", "no-std"]
|
||||
repository = "https://github.com/actix/actix-net.git"
|
||||
keywords = ["waker", "local", "futures", "no-std"]
|
||||
categories = ["asynchronous", "no-std"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2018"
|
||||
|
Reference in New Issue
Block a user