mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Avoid buffering all http headers
Only buffer all http headers if the http_all_headers event is in use.
This commit is contained in:
parent
a342090f18
commit
bc1f2a0a63
3 changed files with 8 additions and 2 deletions
|
@ -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()
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue