Avoid buffering all http headers

Only buffer all http headers if the http_all_headers event is in use.
This commit is contained in:
Justin Azoff 2019-02-23 20:52:30 -05:00
parent a342090f18
commit bc1f2a0a63
3 changed files with 8 additions and 2 deletions

View file

@ -53,6 +53,7 @@ HTTP_Entity::HTTP_Entity(HTTP_Message *arg_message, MIME_Entity* parent_entity,
offset = 0;
instance_length = -1; // unspecified
send_size = true;
want_all_headers = (bool)http_all_headers;
}
void HTTP_Entity::EndOfData()

View file

@ -537,6 +537,7 @@ MIME_Entity::MIME_Entity(MIME_Message* output_message, MIME_Entity* parent_entit
message = output_message;
if ( parent )
content_encoding = parent->ContentTransferEncoding();
want_all_headers = (bool)mime_all_headers;
}
void MIME_Entity::init()
@ -744,7 +745,10 @@ void MIME_Entity::FinishHeader()
{
ParseMIMEHeader(h);
SubmitHeader(h);
if(want_all_headers)
headers.push_back(h);
else
delete h;
}
else
delete h;

View file

@ -173,6 +173,7 @@ protected:
MIME_Message* message;
bool delay_adding_implicit_CRLF;
bool want_all_headers;
};
// The reason I separate MIME_Message as an abstract class is to