mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
io: handle empty vectored writes in simplex (#8353)
This commit is contained in:
@@ -291,6 +291,10 @@ impl AsyncWrite for Sender {
|
||||
return Poll::Ready(Err(IoError::new(IoErrorKind::BrokenPipe, CLOSED_ERROR_MSG)));
|
||||
}
|
||||
|
||||
if bufs.iter().all(|buf| buf.is_empty()) {
|
||||
return Poll::Ready(Ok(0));
|
||||
}
|
||||
|
||||
let free = inner
|
||||
.backpressure_boundary
|
||||
.checked_sub(inner.buf.len())
|
||||
|
||||
Reference in New Issue
Block a user