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().
This commit is contained in:
Daniel Harding
2017-03-27 16:54:56 +02:00
parent 45e69bfb61
commit f5db8136d7
+1 -1
View File
@@ -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)
}