From 3ccbce6bc833959c61f9fd2eb440b2cc7370d0cd Mon Sep 17 00:00:00 2001 From: "Robert G. Jakabosky" Date: Sat, 1 Sep 2018 00:08:53 +0800 Subject: [PATCH] Fix issue with 'Connection: close' in ClientRequest --- src/client/parser.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/parser.rs b/src/client/parser.rs index dd4e60bc..5dd16339 100644 --- a/src/client/parser.rs +++ b/src/client/parser.rs @@ -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))) => (),