Merge branch 'master' into add-awc-get-head-methods

This commit is contained in:
Nikolay Kim 2019-09-25 15:35:20 +06:00 committed by GitHub
commit 6c81861150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 3 deletions

View File

@ -11,6 +11,9 @@
* Allow to re-construct `ServiceRequest` from `HttpRequest` and `Payload` * Allow to re-construct `ServiceRequest` from `HttpRequest` and `Payload`
* Add `HttpServer::listen_uds` for ability to listen on UDS FD rather than path,
which is useful for example with systemd.
### Changed ### Changed
* Make UrlEncodedError::Overflow more informativve * Make UrlEncodedError::Overflow more informativve

View File

@ -79,7 +79,7 @@ actix-router = "0.1.5"
actix-rt = "0.2.4" actix-rt = "0.2.4"
actix-web-codegen = "0.1.2" actix-web-codegen = "0.1.2"
actix-http = "0.2.9" actix-http = "0.2.9"
actix-server = "0.6.0" actix-server = "0.6.1"
actix-server-config = "0.1.2" actix-server-config = "0.1.2"
actix-testing = "0.1.0" actix-testing = "0.1.0"
actix-threadpool = "0.1.1" actix-threadpool = "0.1.1"

View File

@ -1,10 +1,12 @@
# Changes # Changes
## [0.2.7] - 2019-09-25 ## [0.2.7] - 2019-09-25
### Added ### Added
* Remaining getter methods for `ClientRequest`'s private `head` field. * Remaining getter methods for `ClientRequest`'s private `head` field #1101
## [0.2.6] - 2019-09-12 ## [0.2.6] - 2019-09-12

View File

@ -1,6 +1,6 @@
[package] [package]
name = "awc" name = "awc"
version = "0.2.6" version = "0.2.7"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"] authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actix http client." description = "Actix http client."
readme = "README.md" readme = "README.md"

View File

@ -435,6 +435,37 @@ where
Ok(self) Ok(self)
} }
#[cfg(feature = "uds")]
/// Start listening for unix domain connections on existing listener.
///
/// This method is available with `uds` feature.
pub fn listen_uds(
mut self,
lst: std::os::unix::net::UnixListener,
) -> io::Result<Self> {
let cfg = self.config.clone();
let factory = self.factory.clone();
// todo duplicated:
self.sockets.push(Socket {
scheme: "http",
addr: net::SocketAddr::new(
net::IpAddr::V4(net::Ipv4Addr::new(127, 0, 0, 1)),
8080,
),
});
let addr = format!("actix-web-service-{:?}", lst.local_addr()?);
self.builder = self.builder.listen_uds(addr, lst, move || {
let c = cfg.lock();
HttpService::build()
.keep_alive(c.keep_alive)
.client_timeout(c.client_timeout)
.finish(factory())
})?;
Ok(self)
}
#[cfg(feature = "uds")] #[cfg(feature = "uds")]
/// Start listening for incoming unix domain connections. /// Start listening for incoming unix domain connections.
/// ///