From 17f96ba929584e25cd0e91d6049c7b2db48803e7 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 27 Dec 2016 20:17:46 +0000 Subject: [PATCH] Fix TcpSocket::can_recv(). --- src/socket/tcp.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/socket/tcp.rs b/src/socket/tcp.rs index 7b550b2..651f28e 100644 --- a/src/socket/tcp.rs +++ b/src/socket/tcp.rs @@ -315,6 +315,8 @@ impl<'a> TcpSocket<'a> { // In FIN_WAIT_1/2, we have closed our transmit half of the connection but // we still can receive indefinitely. State::FinWait1 | State::FinWait2 => true, + // If we have something in the receive buffer, we can receive that. + _ if self.rx_buffer.len() > 0 => true, _ => false } }