mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-02 00:00:11 +02:00
Fix non-terminating loop in tokio_io::length_delimited::FramedWrite (#576)
* tokio-io: fix non-terminating loop in length_delimited::FramedWrite (#497)
This commit is contained in:
committed by
Toby Lawrence
parent
a7b053372f
commit
bc91bc5022
@@ -455,7 +455,12 @@ impl<T: AsyncWrite, B: IntoBuf> FramedWrite<T, B> {
|
||||
|
||||
loop {
|
||||
let frame = self.frame.as_mut().unwrap();
|
||||
try_ready!(self.inner.write_buf(frame));
|
||||
if try_ready!(self.inner.write_buf(frame)) == 0 {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::WriteZero,
|
||||
"failed to write frame to transport",
|
||||
));
|
||||
}
|
||||
|
||||
if !frame.has_remaining() {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user