From f5db8136d7ca11a4cd8645b6f2ea1c0406254e1c Mon Sep 17 00:00:00 2001 From: Daniel Harding Date: Mon, 27 Mar 2017 16:54:56 +0200 Subject: [PATCH] Fix logic error in TcpStream.read_buf() If the underlying read_bufs() call returned a WouldBlock error, TcpStream.read_buf() was erroneously calling self.io.need_write(), when it should actually call self.io.need_read(). --- src/net/tcp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/tcp.rs b/src/net/tcp.rs index b20f18ec7..a0d441244 100644 --- a/src/net/tcp.rs +++ b/src/net/tcp.rs @@ -526,7 +526,7 @@ impl<'a> AsyncRead for &'a TcpStream { } Err(e) => { if e.kind() == io::ErrorKind::WouldBlock { - self.io.need_write(); + self.io.need_read(); } Err(e) }