Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/fd/socket/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,7 @@ impl ObjectInterface for Socket {
| tcp::State::TimeWait => Poll::Ready(Err(Errno::Io)),
_ => {
if socket.can_recv() {
Poll::Ready(
socket
.recv(|data| {
let len = core::cmp::min(buffer.len(), data.len());
buffer[..len].copy_from_slice(&data[..len]);
(len, len)
})
.map_err(|_| Errno::Io),
)
Poll::Ready(socket.recv_slice(buffer).map_err(|_| Errno::Io))
} else if state == tcp::State::CloseWait {
// The local end-point has received a connection termination request
// and not data are in the receive buffer => return 0 to close the connection
Expand Down
Loading