Fixed headerOnly flag in HTTP::Parser

This commit is contained in:
Thulinma 2020-09-24 19:52:37 +02:00
parent 158058c4d5
commit f472da06f3

View file

@ -624,8 +624,8 @@ bool HTTP::Parser::parse(std::string &HTTPbuffer, Util::DataCallback &cb){
} }
} }
if (seenHeaders){ if (seenHeaders){
if (headerOnly){return true;}
if (length > 0){ if (length > 0){
if (headerOnly){return true;}
unsigned int toappend = length - body.length(); unsigned int toappend = length - body.length();
// limit the amount of bytes that will be appended to the amount there // 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{ }else{
if (getChunks){ if (getChunks){
// toappend
currentLength += HTTPbuffer.size(); currentLength += HTTPbuffer.size();
if (headerOnly){return true;}
if (doingChunk){ if (doingChunk){
unsigned int toappend = HTTPbuffer.size(); unsigned int toappend = HTTPbuffer.size();
if (toappend > doingChunk){toappend = doingChunk;} if (toappend > doingChunk){toappend = doingChunk;}