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 (length > 0){
if (headerOnly){return true;}
if (length > 0){
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;}