1
0
Fork 0

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
1 changed files with 1 additions and 0 deletions

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)