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; offset = 0;
instance_length = -1; // unspecified instance_length = -1; // unspecified
send_size = true; send_size = true;
want_all_headers = (bool)http_all_headers;
} }
void HTTP_Entity::EndOfData() 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; message = output_message;
if ( parent ) if ( parent )
content_encoding = parent->ContentTransferEncoding(); content_encoding = parent->ContentTransferEncoding();
want_all_headers = (bool)mime_all_headers;
} }
void MIME_Entity::init() void MIME_Entity::init()
@ -744,8 +745,11 @@ void MIME_Entity::FinishHeader()
{ {
ParseMIMEHeader(h); ParseMIMEHeader(h);
SubmitHeader(h); SubmitHeader(h);
headers.push_back(h); if(want_all_headers)
} headers.push_back(h);
else
delete h;
}
else else
delete h; delete h;
} }

View file

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