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