From 02b384ff2eabaf18827cf7272d1343f4bbeabe28 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 6 Mar 2014 14:49:51 +0100 Subject: [PATCH] Changed HTTP.Read(Socket::Connection&) call to only return false if reading a whole request/response isn't possible (yet). --- lib/http_parser.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/http_parser.cpp b/lib/http_parser.cpp index 5ed58e0b..bcdb1763 100644 --- a/lib/http_parser.cpp +++ b/lib/http_parser.cpp @@ -326,7 +326,14 @@ bool HTTP::Parser::Read(Socket::Connection & conn){ return false; } } - return parse(conn.Received().get()); + //if a parse succeeds, simply return true + if (parse(conn.Received().get())){ + return true; + } + //otherwise, if we have parts left, call ourselves recursively + if (conn.Received().size()){ + return Read(conn); + } } //HTTPReader::Read /// Attempt to read a whole HTTP request or response from a std::string buffer.