mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
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:
+1
-1
@@ -526,7 +526,7 @@ impl<'a> AsyncRead for &'a TcpStream {
|
|||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
if e.kind() == io::ErrorKind::WouldBlock {
|
if e.kind() == io::ErrorKind::WouldBlock {
|
||||||
self.io.need_write();
|
self.io.need_read();
|
||||||
}
|
}
|
||||||
Err(e)
|
Err(e)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user