1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-30 18:34:36 +01:00

Fix connection get closed too early

This commit is contained in:
Nikolay Kim 2018-03-11 15:37:33 -07:00
parent 31fbbd3168
commit 051703eb2c
2 changed files with 9 additions and 14 deletions

View File

@ -4,6 +4,8 @@
* Fix panic on unknown content encoding
* Fix connection get closed too early
## 0.4.6 (2018-03-10)
* Fix client cookie handling

View File

@ -110,18 +110,6 @@ impl<T, H> Http1<T, H>
}
}
fn poll_completed(&mut self, shutdown: bool) -> Result<bool, ()> {
// check stream state
match self.stream.poll_completed(shutdown) {
Ok(Async::Ready(_)) => Ok(true),
Ok(Async::NotReady) => Ok(false),
Err(err) => {
debug!("Error sending data: {}", err);
Err(())
}
}
}
// TODO: refactor
pub fn poll_io(&mut self) -> Poll<bool, ()> {
// read incoming data
@ -272,8 +260,13 @@ impl<T, H> Http1<T, H>
}
// check stream state
if !self.poll_completed(true)? {
return Ok(Async::NotReady)
match self.stream.poll_completed(self.tasks.is_empty()) {
Ok(Async::NotReady) => return Ok(Async::NotReady),
Err(err) => {
debug!("Error sending data: {}", err);
return Err(())
}
_ => (),
}
// deal with keep-alive