forked from M-Labs/zynq-rs
libasync: assert that callback consumes data in smoltcp recv
This commit is contained in:
parent
f8785c3f07
commit
84f1380f48
|
@ -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…
Reference in New Issue