1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 08:22:59 +01:00

set nodelay for streams

This commit is contained in:
Nikolay Kim 2018-01-04 09:32:47 -08:00
parent 91230afc44
commit 20d5c61c11

View File

@ -209,6 +209,7 @@ impl StreamHandlerType {
hnd: &Handle, msg: Conn<net::TcpStream>) {
match *self {
StreamHandlerType::Normal => {
let _ = msg.io.set_nodelay(true);
let io = TcpStream::from_stream(msg.io, hnd)
.expect("failed to associate TCP stream");
@ -217,6 +218,7 @@ impl StreamHandlerType {
#[cfg(feature="tls")]
StreamHandlerType::Tls(ref acceptor) => {
let Conn { io, peer, http2 } = msg;
let _ = io.set_nodelay(true);
let io = TcpStream::from_stream(io, hnd)
.expect("failed to associate TCP stream");
@ -235,6 +237,7 @@ impl StreamHandlerType {
#[cfg(feature="alpn")]
StreamHandlerType::Alpn(ref acceptor) => {
let Conn { io, peer, .. } = msg;
let _ = io.set_nodelay(true);
let io = TcpStream::from_stream(io, hnd)
.expect("failed to associate TCP stream");