mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-01 02:31:33 +00:00
Return WouldBlock
if flushing did not complete. (#265)
This commit is contained in:
@ -145,8 +145,10 @@ where
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn flush(&mut self) -> Result<(), IoError> {
|
fn flush(&mut self) -> Result<(), IoError> {
|
||||||
self.inner.poll_complete()?;
|
match self.inner.poll_complete()? {
|
||||||
Ok(())
|
Async::Ready(()) => Ok(()),
|
||||||
|
Async::NotReady => Err(IoError::new(IoErrorKind::WouldBlock, "not ready"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user