From a7373a1ca4ef7daa3aaa2a46724eee477d07cf7c Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Mon, 15 Sep 2014 13:38:52 -0500 Subject: [PATCH] Remove unneeded allocations for HTTP messages. --- CHANGES | 4 ++++ VERSION | 2 +- src/analyzer/protocol/http/HTTP.cc | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index a6369c5e7b..1135150ac2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ +2.3-172 | 2014-09-15 13:38:52 -0500 + + * Remove unneeded allocations for HTTP messages. (Jon Siwek) + 2.3-171 | 2014-09-15 11:14:57 -0500 * Fix a compile error on systems without pcap-int.h. (Jon Siwek) diff --git a/VERSION b/VERSION index 9f2d4b5ba4..839b876868 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3-171 +2.3-172 diff --git a/src/analyzer/protocol/http/HTTP.cc b/src/analyzer/protocol/http/HTTP.cc index cbe8320ed5..4d00ca85aa 100644 --- a/src/analyzer/protocol/http/HTTP.cc +++ b/src/analyzer/protocol/http/HTTP.cc @@ -545,7 +545,7 @@ HTTP_Message::HTTP_Message(HTTP_Analyzer* arg_analyzer, current_entity = 0; top_level = new HTTP_Entity(this, 0, expect_body); - entity_data_buffer = new char[http_entity_data_delivery_size]; + entity_data_buffer = 0; BeginEntity(top_level); start_time = network_time; @@ -718,6 +718,9 @@ void HTTP_Message::SubmitData(int len, const char* buf) int HTTP_Message::RequestBuffer(int* plen, char** pbuf) { + if ( ! entity_data_buffer ) + entity_data_buffer = new char[http_entity_data_delivery_size]; + *plen = http_entity_data_delivery_size; *pbuf = entity_data_buffer; return 1;