1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-26 18:10:37 +00:00

set nodelay on socket #560

This commit is contained in:
Nikolay Kim 2018-11-08 16:29:43 -08:00
parent aed3933ae8
commit 7065c540e1
3 changed files with 35 additions and 14 deletions

View file

@ -2,18 +2,20 @@
## [0.7.14] - 2018-11-x
### Added
* Add method to configure custom error handler to `Query` and `Path` extractors.
* Add method to configure `SameSite` option in `CookieIdentityPolicy`.
### Fixed
* Fix keep-alive timer reset
* HttpServer now treats streaming bodies the same for HTTP/1.x protocols. #549
### Added
* Add method to configure custom error handler to `Query` and `Path` extractors.
* Add method to configure `SameSite` option in `CookieIdentityPolicy`.
* Set nodelay for socket #560
## [0.7.13] - 2018-10-14

View file

@ -9,14 +9,20 @@ use super::acceptor::{
};
use super::error::AcceptorError;
use super::handler::IntoHttpHandler;
use super::service::HttpService;
use super::service::{HttpService, StreamConfiguration};
use super::settings::{ServerSettings, ServiceConfig};
use super::KeepAlive;
pub(crate) trait ServiceProvider {
fn register(
&self, server: Server, lst: net::TcpListener, host: String,
addr: net::SocketAddr, keep_alive: KeepAlive, secure: bool, client_timeout: u64,
&self,
server: Server,
lst: net::TcpListener,
host: String,
addr: net::SocketAddr,
keep_alive: KeepAlive,
secure: bool,
client_timeout: u64,
client_shutdown: u64,
) -> Server;
}
@ -43,8 +49,13 @@ where
}
fn finish(
&self, host: String, addr: net::SocketAddr, keep_alive: KeepAlive, secure: bool,
client_timeout: u64, client_shutdown: u64,
&self,
host: String,
addr: net::SocketAddr,
keep_alive: KeepAlive,
secure: bool,
client_timeout: u64,
client_shutdown: u64,
) -> impl ServiceFactory {
let factory = self.factory.clone();
let acceptor = self.acceptor.clone();
@ -65,6 +76,7 @@ where
acceptor.create(),
)).map_err(|_| ())
.map_init_err(|_| ())
.and_then(StreamConfiguration::new().nodelay(true))
.and_then(
HttpService::new(settings)
.map_init_err(|_| ())
@ -76,6 +88,7 @@ where
TcpAcceptor::new(acceptor.create().map_err(AcceptorError::Service))
.map_err(|_| ())
.map_init_err(|_| ())
.and_then(StreamConfiguration::new().nodelay(true))
.and_then(
HttpService::new(settings)
.map_init_err(|_| ())
@ -95,8 +108,14 @@ where
H: IntoHttpHandler,
{
fn register(
&self, server: Server, lst: net::TcpListener, host: String,
addr: net::SocketAddr, keep_alive: KeepAlive, secure: bool, client_timeout: u64,
&self,
server: Server,
lst: net::TcpListener,
host: String,
addr: net::SocketAddr,
keep_alive: KeepAlive,
secure: bool,
client_timeout: u64,
client_shutdown: u64,
) -> Server {
server.listen2(

View file

@ -88,7 +88,7 @@ where
Ok(Async::Ready(()))
}
fn call(&mut self, req: Self::Request) -> Self::Future {
fn call(&mut self, mut req: Self::Request) -> Self::Future {
HttpChannel::new(self.settings.clone(), req)
}
}