write buf again
This commit is contained in:
parent
163a96b062
commit
02ff36428c
@ -111,11 +111,16 @@ impl<'a, IO: AsyncRead + AsyncWrite, S: Session> Write for Stream<'a, IO, S> {
|
||||
}
|
||||
}
|
||||
|
||||
if len == 0 && !buf.is_empty() {
|
||||
// not write zero
|
||||
Err(io::ErrorKind::WouldBlock.into())
|
||||
} else {
|
||||
if len != 0 || buf.is_empty() {
|
||||
Ok(len)
|
||||
} else {
|
||||
// not write zero
|
||||
self.session.write(buf)
|
||||
.and_then(|len| if len != 0 {
|
||||
Ok(len)
|
||||
} else {
|
||||
Err(io::ErrorKind::WouldBlock.into())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user