Browse Source

libasync: assert that callback consumes data in smoltcp recv

tcp-recv-fnmut
parent
commit
84f1380f48
  1. 1
      libasync/src/smoltcp/tcp_stream.rs

1
libasync/src/smoltcp/tcp_stream.rs

@ -127,6 +127,7 @@ impl TcpStream {
socket.recv(|buf| {
if buf.len() > 0 {
let (amount, result) = (self.f)(buf);
assert!(amount > 0);
(amount, Poll::Ready(Ok(result)))
} else {
(0, Poll::Pending)

Loading…
Cancel
Save