libasync: assert that callback consumes data in smoltcp recv

This commit is contained in:
Sebastien Bourdeauducq 2020-07-19 16:14:22 +08:00
parent f8785c3f07
commit 84f1380f48

View File

@ -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)