mirror of
https://github.com/fafhrd91/actix-net
synced 2025-08-12 16:47:05 +02:00
Compare commits
6 Commits
server-v0.
...
testing-v0
Author | SHA1 | Date | |
---|---|---|---|
|
0b0060fe47 | ||
|
35e32d8e55 | ||
|
9982a9498d | ||
|
fa72975f34 | ||
|
fe5de2510d | ||
|
f6f9e1fcdb |
26
Cargo.toml
26
Cargo.toml
@@ -1,18 +1,3 @@
|
||||
[package]
|
||||
name = "actix-net"
|
||||
version = "0.3.0"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix net - framework for the composable network services for Rust"
|
||||
readme = "README.md"
|
||||
keywords = ["network", "framework", "async", "futures"]
|
||||
homepage = "https://actix.rs"
|
||||
repository = "https://github.com/actix/actix-net.git"
|
||||
documentation = "https://docs.rs/actix-net/"
|
||||
categories = ["network-programming", "asynchronous"]
|
||||
license = "MIT/Apache-2.0"
|
||||
exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"]
|
||||
edition = "2018"
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"actix-codec",
|
||||
@@ -28,17 +13,6 @@ members = [
|
||||
"router",
|
||||
]
|
||||
|
||||
[dev-dependencies]
|
||||
actix-service = "0.4.0"
|
||||
actix-codec = "0.1.1"
|
||||
actix-rt = "0.2.0"
|
||||
actix-server = { version="0.5.0", features=["ssl"] }
|
||||
env_logger = "0.6"
|
||||
futures = "0.1.25"
|
||||
openssl = "0.10"
|
||||
tokio-tcp = "0.1"
|
||||
tokio-openssl = "0.3"
|
||||
|
||||
[patch.crates-io]
|
||||
actix-codec = { path = "actix-codec" }
|
||||
actix-connect = { path = "actix-connect" }
|
||||
|
@@ -209,6 +209,7 @@ where
|
||||
// get a spurious 0 that looks like EOF
|
||||
self.buffer.reserve(1);
|
||||
if 0 == try_ready!(self.inner.read_buf(&mut self.buffer)) {
|
||||
trace!("read 0 bytes, mark stream as eof");
|
||||
self.eof = true;
|
||||
}
|
||||
|
||||
|
@@ -57,5 +57,5 @@ webpki = { version = "0.21", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
bytes = "0.4"
|
||||
actix-testing = { version="0.1.0" }
|
||||
actix-testing = { version="0.2.0" }
|
||||
actix-server-config = "0.2.0"
|
||||
|
@@ -94,7 +94,8 @@ where
|
||||
fn call(&mut self, stream: Connection<T, U>) -> Self::Future {
|
||||
trace!("SSL Handshake start for: {:?}", stream.host());
|
||||
let (io, stream) = stream.replace(());
|
||||
let host = DNSNameRef::try_from_ascii_str(stream.host()).unwrap();
|
||||
let host = DNSNameRef::try_from_ascii_str(stream.host())
|
||||
.expect("rustls currently only handles hostname-based connections. See https://github.com/briansmith/webpki/issues/54");
|
||||
ConnectAsyncExt {
|
||||
fut: TlsConnector::from(self.connector.clone()).connect(host, io),
|
||||
stream: Some(stream),
|
||||
|
@@ -42,6 +42,7 @@ fn test_rustls_string() {
|
||||
let con = test::call_service(&mut conn, addr.into());
|
||||
assert_eq!(con.peer_addr().unwrap(), srv.addr());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_static_str() {
|
||||
let srv = TestServer::with(|| {
|
||||
|
@@ -28,8 +28,8 @@ log = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "0.2.2"
|
||||
actix-connect = "0.2.0"
|
||||
actix-testing = "0.1.0"
|
||||
actix-connect = "0.3.0"
|
||||
actix-testing = "0.2.0"
|
||||
actix-server-config = "0.2.0"
|
||||
tokio-tcp = "0.1"
|
||||
tokio-timer = "0.2"
|
||||
|
@@ -147,6 +147,7 @@ where
|
||||
}
|
||||
Ok(Async::NotReady) => return false,
|
||||
Ok(Async::Ready(None)) => {
|
||||
log::trace!("Client disconnected");
|
||||
self.dispatch_state = FramedState::Stopping;
|
||||
return true;
|
||||
}
|
||||
|
@@ -1,5 +1,10 @@
|
||||
# Changes
|
||||
|
||||
## [0.2.0] - 2019-10-14
|
||||
|
||||
* Upgrade actix-server and actix-server-config deps
|
||||
|
||||
|
||||
## [0.1.0] - 2019-09-25
|
||||
|
||||
* Initial impl
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-testing"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix testing utils"
|
||||
keywords = ["network", "framework", "async", "futures"]
|
||||
@@ -17,10 +17,10 @@ name = "actix_testing"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "0.2.1"
|
||||
actix-rt = "0.2.5"
|
||||
actix-server = "0.7.0"
|
||||
actix-server-config = "0.2.0"
|
||||
actix-service = "0.4.0"
|
||||
actix-service = "0.4.2"
|
||||
|
||||
log = "0.4"
|
||||
net2 = "0.2"
|
||||
|
@@ -1,5 +1,10 @@
|
||||
# Changes
|
||||
|
||||
## [0.4.6] - 2019-10-08
|
||||
|
||||
* Refactor `Counter` type. register current task in available method.
|
||||
|
||||
|
||||
## [0.4.5] - 2019-07-19
|
||||
|
||||
### Removed
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-utils"
|
||||
version = "0.4.5"
|
||||
version = "0.4.6"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix utils - various actix net related services"
|
||||
keywords = ["network", "framework", "async", "futures"]
|
||||
|
@@ -25,11 +25,13 @@ impl Counter {
|
||||
}))
|
||||
}
|
||||
|
||||
/// Get counter guard.
|
||||
pub fn get(&self) -> CounterGuard {
|
||||
CounterGuard::new(self.0.clone())
|
||||
}
|
||||
|
||||
/// Check if counter is not at capacity
|
||||
/// Check if counter is not at capacity. If counter at capacity
|
||||
/// it registers notification for current task.
|
||||
pub fn available(&self) -> bool {
|
||||
self.0.available()
|
||||
}
|
||||
@@ -57,11 +59,7 @@ impl Drop for CounterGuard {
|
||||
|
||||
impl CounterInner {
|
||||
fn inc(&self) {
|
||||
let num = self.count.get() + 1;
|
||||
self.count.set(num);
|
||||
if num == self.capacity {
|
||||
self.task.register();
|
||||
}
|
||||
self.count.set(self.count.get() + 1);
|
||||
}
|
||||
|
||||
fn dec(&self) {
|
||||
@@ -73,6 +71,11 @@ impl CounterInner {
|
||||
}
|
||||
|
||||
fn available(&self) -> bool {
|
||||
self.count.get() < self.capacity
|
||||
if self.count.get() < self.capacity {
|
||||
true
|
||||
} else {
|
||||
self.task.register();
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user