return NotReady when recv_from wouldblock in uds (#452)

This commit is contained in:
Patrick Barrett 2018-07-11 13:37:57 -05:00 committed by Carl Lerche
parent f98b81e527
commit e6fc3d209d

View File

@ -104,6 +104,7 @@ impl UnixDatagram {
let r = self.io.get_ref().recv_from(buf);
if is_wouldblock(&r) {
self.io.clear_read_ready(Ready::readable())?;
return Ok(Async::NotReady);
}
r.map(Async::Ready)
}
@ -118,6 +119,7 @@ impl UnixDatagram {
let r = self.io.get_ref().recv(buf);
if is_wouldblock(&r) {
self.io.clear_read_ready(Ready::readable())?;
return Ok(Async::NotReady);
}
r.map(Async::Ready)
}