From 20d5c61c11f14c10dec1d3b89a78512743fdff12 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 4 Jan 2018 09:32:47 -0800 Subject: [PATCH] set nodelay for streams --- src/worker.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/worker.rs b/src/worker.rs index d0f73f63..188678a7 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -209,6 +209,7 @@ impl StreamHandlerType { hnd: &Handle, msg: Conn) { 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");