1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-23 10:01:06 +00:00

Fix issue with 'Connection: close' in ClientRequest

This commit is contained in:
Robert G. Jakabosky 2018-09-01 00:08:53 +08:00
parent 8393d09a0f
commit 3ccbce6bc8

View file

@ -41,7 +41,8 @@ impl HttpResponseParser {
// if buf is empty parse_message will always return NotReady, let's avoid that
if buf.is_empty() {
match io.read_available(buf) {
Ok(Async::Ready((_, true))) => {
Ok(Async::Ready((true, true))) => (),
Ok(Async::Ready((false, true))) => {
return Err(HttpResponseParserError::Disconnect)
}
Ok(Async::Ready((_, false))) => (),
@ -63,7 +64,8 @@ impl HttpResponseParser {
return Err(HttpResponseParserError::Error(ParseError::TooLarge));
}
match io.read_available(buf) {
Ok(Async::Ready((_, true))) => {
Ok(Async::Ready((true, true))) => (),
Ok(Async::Ready((false, true))) => {
return Err(HttpResponseParserError::Disconnect)
}
Ok(Async::Ready((_, false))) => (),