1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 09:42:57 +01:00

Fix stream draining for http/2 connections #290

This commit is contained in:
Nikolay Kim 2018-07-25 15:38:02 -07:00
parent f58065082e
commit 80fbc2e9ec
4 changed files with 12 additions and 4 deletions

View File

@ -23,6 +23,8 @@
* Missing response header "content-encoding" #421
* Fix stream draining for http/2 connections #290
## [0.7.1] - 2018-07-21

View File

@ -409,7 +409,7 @@ struct ProcessResponse<S, H> {
_h: PhantomData<H>,
}
#[derive(PartialEq)]
#[derive(PartialEq, Debug)]
enum RunningState {
Running,
Paused,

View File

@ -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(_)) => {

View File

@ -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(()))
}
}