From f472da06f391e11d355aeb99eefed73c3e35df7f Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 24 Sep 2020 19:52:37 +0200 Subject: [PATCH] Fixed headerOnly flag in HTTP::Parser --- lib/http_parser.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/http_parser.cpp b/lib/http_parser.cpp index bf90585d..7b86d5d5 100644 --- a/lib/http_parser.cpp +++ b/lib/http_parser.cpp @@ -624,8 +624,8 @@ bool HTTP::Parser::parse(std::string &HTTPbuffer, Util::DataCallback &cb){ } } if (seenHeaders){ + if (headerOnly){return true;} if (length > 0){ - if (headerOnly){return true;} unsigned int toappend = length - body.length(); // limit the amount of bytes that will be appended to the amount there @@ -661,11 +661,7 @@ bool HTTP::Parser::parse(std::string &HTTPbuffer, Util::DataCallback &cb){ } }else{ if (getChunks){ - - // toappend currentLength += HTTPbuffer.size(); - - if (headerOnly){return true;} if (doingChunk){ unsigned int toappend = HTTPbuffer.size(); if (toappend > doingChunk){toappend = doingChunk;}