Browse Source

Fix TcpSocket::can_recv().

whitequark 8 năm trước cách đây
mục cha
commit
0c0ed8406e
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      src/socket/tcp.rs

+ 2 - 0
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
         }
     }