mirror of
https://github.com/fafhrd91/actix-net
synced 2025-08-14 10:00:31 +02:00
Compare commits
3 Commits
utils-v0.4
...
server-con
Author | SHA1 | Date | |
---|---|---|---|
|
2955e49d78 | ||
|
9d1b428b34 | ||
|
42d526bced |
12
.travis.yml
12
.travis.yml
@@ -10,9 +10,9 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
- rust: stable
|
- rust: stable
|
||||||
- rust: beta
|
- rust: beta
|
||||||
- rust: nightly-2019-03-02
|
- rust: nightly-2019-06-15
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rust: nightly-2019-03-02
|
- rust: nightly-2019-06-15
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
@@ -25,8 +25,8 @@ before_install:
|
|||||||
- sudo apt-get install -y openssl libssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
|
- sudo apt-get install -y openssl libssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
|
||||||
|
|
||||||
before_cache: |
|
before_cache: |
|
||||||
if [[ "$TRAVIS_RUST_VERSION" == "nightly-2019-03-02" ]]; then
|
if [[ "$TRAVIS_RUST_VERSION" == "nightly-2019-06-15" ]]; then
|
||||||
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin
|
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install --version 0.6.11 cargo-tarpaulin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add clippy
|
# Add clippy
|
||||||
@@ -35,14 +35,14 @@ before_script:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
if [[ "$TRAVIS_RUST_VERSION" != "nightly-2019-03-02" ]]; then
|
if [[ "$TRAVIS_RUST_VERSION" != "nightly-2019-06-15" ]]; then
|
||||||
cargo clean
|
cargo clean
|
||||||
cargo test --all --all-features -- --nocapture
|
cargo test --all --all-features -- --nocapture
|
||||||
fi
|
fi
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- |
|
- |
|
||||||
if [[ "$TRAVIS_RUST_VERSION" == "nightly-2019-03-02" ]]; then
|
if [[ "$TRAVIS_RUST_VERSION" == "nightly-2019-06-15" ]]; then
|
||||||
taskset -c 0 cargo tarpaulin --all --all-features --out Xml
|
taskset -c 0 cargo tarpaulin --all --all-features --out Xml
|
||||||
echo "Uploaded code coverage"
|
echo "Uploaded code coverage"
|
||||||
bash <(curl -s https://codecov.io/bash)
|
bash <(curl -s https://codecov.io/bash)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## [0.1.0] - 2019-xx-xx
|
## [0.1.0] - 2019-07-17
|
||||||
|
|
||||||
* Initial release
|
* Initial release
|
||||||
|
@@ -29,7 +29,7 @@ impl<T> Cell<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_mut(&mut self) -> &mut T {
|
pub(crate) unsafe fn get_mut(&mut self) -> &mut T {
|
||||||
unsafe { &mut *self.inner.as_ref().get() }
|
&mut *self.inner.as_ref().get()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -153,7 +153,7 @@ where
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut cell = self.inner.clone();
|
let mut cell = self.inner.clone();
|
||||||
cell.get_mut().task.register();
|
unsafe { cell.get_mut().task.register() };
|
||||||
tokio_current_thread::spawn(
|
tokio_current_thread::spawn(
|
||||||
self.service
|
self.service
|
||||||
.call(Item::new(self.state.clone(), self.sink.clone(), item))
|
.call(Item::new(self.state.clone(), self.sink.clone(), item))
|
||||||
@@ -163,9 +163,11 @@ where
|
|||||||
Ok(None) => return Ok(()),
|
Ok(None) => return Ok(()),
|
||||||
Err(err) => Err(err),
|
Err(err) => Err(err),
|
||||||
};
|
};
|
||||||
let inner = cell.get_mut();
|
unsafe {
|
||||||
inner.buf.push_back(item);
|
let inner = cell.get_mut();
|
||||||
inner.task.notify();
|
inner.buf.push_back(item);
|
||||||
|
inner.task.notify();
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -181,7 +183,7 @@ where
|
|||||||
|
|
||||||
/// write to framed object
|
/// write to framed object
|
||||||
fn poll_write(&mut self) -> bool {
|
fn poll_write(&mut self) -> bool {
|
||||||
let inner = self.inner.get_mut();
|
let inner = unsafe { self.inner.get_mut() };
|
||||||
let mut rx_done = self.rx.is_none();
|
let mut rx_done = self.rx.is_none();
|
||||||
let mut buf_empty = inner.buf.is_empty();
|
let mut buf_empty = inner.buf.is_empty();
|
||||||
loop {
|
loop {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-server-config"
|
name = "actix-server-config"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Actix server config utils"
|
description = "Actix server config utils"
|
||||||
homepage = "https://actix.rs"
|
homepage = "https://actix.rs"
|
||||||
@@ -14,7 +14,7 @@ name = "actix_server_config"
|
|||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = ["ssl", "rust-tls"]
|
features = ["ssl", "rust-tls", "uds"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
@@ -25,6 +25,9 @@ ssl = ["tokio-openssl"]
|
|||||||
# rustls
|
# rustls
|
||||||
rust-tls = ["rustls", "tokio-rustls"]
|
rust-tls = ["rustls", "tokio-rustls"]
|
||||||
|
|
||||||
|
# unix domain sockets
|
||||||
|
uds = ["tokio-uds"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "0.1.25"
|
futures = "0.1.25"
|
||||||
tokio-io = "0.1.12"
|
tokio-io = "0.1.12"
|
||||||
@@ -32,3 +35,4 @@ tokio-tcp = "0.1"
|
|||||||
tokio-openssl = { version="0.3.0", optional = true }
|
tokio-openssl = { version="0.3.0", optional = true }
|
||||||
rustls = { version = "0.15.2", optional = true }
|
rustls = { version = "0.15.2", optional = true }
|
||||||
tokio-rustls = { version = "0.9.1", optional = true }
|
tokio-rustls = { version = "0.9.1", optional = true }
|
||||||
|
tokio-uds = { version="0.2.5", optional = true }
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.1.2] - 2019-07-18
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Add unix domnain sockets support
|
||||||
|
|
||||||
|
|
||||||
## [0.1.1] - 2019-04-16
|
## [0.1.1] - 2019-04-16
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@@ -95,9 +95,9 @@ impl<T, P> Io<T, P> {
|
|||||||
/// Return new Io object with new parameter.
|
/// Return new Io object with new parameter.
|
||||||
pub fn set<U>(self, params: U) -> Io<T, U> {
|
pub fn set<U>(self, params: U) -> Io<T, U> {
|
||||||
Io {
|
Io {
|
||||||
|
params,
|
||||||
io: self.io,
|
io: self.io,
|
||||||
proto: self.proto,
|
proto: self.proto,
|
||||||
params: params,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,3 +216,26 @@ impl<T: IoStream> IoStream for tokio_rustls::TlsStream<T, rustls::ServerSession>
|
|||||||
self.get_mut().0.set_keepalive(dur)
|
self.get_mut().0.set_keepalive(dur)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(all(unix, feature = "uds"))]
|
||||||
|
impl IoStream for tokio_uds::UnixStream {
|
||||||
|
#[inline]
|
||||||
|
fn peer_addr(&self) -> Option<net::SocketAddr> {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn set_nodelay(&mut self, _: bool) -> io::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn set_linger(&mut self, _: Option<time::Duration>) -> io::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn set_keepalive(&mut self, _: Option<time::Duration>) -> io::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.4.4] - 2019-07-17
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Undeprecate `FramedTransport` as it is actually useful
|
||||||
|
|
||||||
|
|
||||||
## [0.4.3] - 2019-07-17
|
## [0.4.3] - 2019-07-17
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-utils"
|
name = "actix-utils"
|
||||||
version = "0.4.3"
|
version = "0.4.4"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Actix utils - various actix net related services"
|
description = "Actix utils - various actix net related services"
|
||||||
keywords = ["network", "framework", "async", "futures"]
|
keywords = ["network", "framework", "async", "futures"]
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
#![allow(deprecated)]
|
|
||||||
//! Framed dispatcher service and related utilities
|
//! Framed dispatcher service and related utilities
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::{fmt, mem};
|
use std::{fmt, mem};
|
||||||
@@ -15,8 +14,6 @@ use crate::cell::Cell;
|
|||||||
type Request<U> = <U as Decoder>::Item;
|
type Request<U> = <U as Decoder>::Item;
|
||||||
type Response<U> = <U as Encoder>::Item;
|
type Response<U> = <U as Encoder>::Item;
|
||||||
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[deprecated(since = "0.4.3", note = "support will be removed in actix-utils 0.4.5")]
|
|
||||||
/// Framed transport errors
|
/// Framed transport errors
|
||||||
pub enum FramedTransportError<E, U: Encoder + Decoder> {
|
pub enum FramedTransportError<E, U: Encoder + Decoder> {
|
||||||
Service(E),
|
Service(E),
|
||||||
@@ -66,18 +63,11 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[deprecated(since = "0.4.3", note = "support will be removed in actix-utils 0.4.5")]
|
|
||||||
pub enum FramedMessage<T> {
|
pub enum FramedMessage<T> {
|
||||||
Message(T),
|
Message(T),
|
||||||
Close,
|
Close,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[deprecated(
|
|
||||||
since = "0.4.3",
|
|
||||||
note = "please use `actix_ioframe` instead. support will be removed in actix-utils 0.4.5"
|
|
||||||
)]
|
|
||||||
/// FramedTransport - is a future that reads frames from Framed object
|
/// FramedTransport - is a future that reads frames from Framed object
|
||||||
/// and pass then to the service.
|
/// and pass then to the service.
|
||||||
pub struct FramedTransport<S, T, U>
|
pub struct FramedTransport<S, T, U>
|
||||||
|
Reference in New Issue
Block a user