mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-29 19:24:58 +02:00
Fix stream draining for http/2 connections #290
This commit is contained in:
@ -155,7 +155,9 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
if !item.flags.contains(EntryFlags::WRITE_DONE) {
|
||||
if item.flags.contains(EntryFlags::FINISHED)
|
||||
&& !item.flags.contains(EntryFlags::WRITE_DONE)
|
||||
{
|
||||
match item.stream.poll_completed(false) {
|
||||
Ok(Async::NotReady) => (),
|
||||
Ok(Async::Ready(_)) => {
|
||||
|
@ -245,14 +245,18 @@ impl<H: 'static> Writer for H2Writer<H> {
|
||||
let cap = cmp::min(self.buffer.len(), CHUNK_SIZE);
|
||||
stream.reserve_capacity(cap);
|
||||
} else {
|
||||
if eof {
|
||||
stream.reserve_capacity(0);
|
||||
continue;
|
||||
}
|
||||
self.flags.remove(Flags::RESERVED);
|
||||
return Ok(Async::NotReady);
|
||||
return Ok(Async::Ready(()));
|
||||
}
|
||||
}
|
||||
Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(Async::NotReady)
|
||||
Ok(Async::Ready(()))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user