protocol: remove redundant WouldBlock handling

The packet reading code already translates this to a bool.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-03-07 13:48:58 +01:00
parent d721a688d0
commit b08b44c046

View File

@ -106,14 +106,6 @@ where
match self.poll_data_do() {
Ok(has_packet) => Ok(has_packet),
Err(e) => {
// To support AsyncRead/AsyncWrite we do not enter a failed
// state when we read from a non-blocking source which fails
// with WouldBlock.
if let Some(ioe) = e.downcast_ref::<std::io::Error>() {
if ioe.kind() == io::ErrorKind::WouldBlock {
return Ok(false);
}
}
self.error = true;
Err(e)
}