From: Michael Altizer (mialtize) Date: Mon, 3 Jun 2019 18:05:33 +0000 (-0400) Subject: Merge pull request #1624 in SNORT/snort3 from ~BBANTWAL/snort3:fix_async_http to... X-Git-Tag: 3.0.0-257~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5496e0ca73158a8cf039921372e0518e8ccee560;p=thirdparty%2Fsnort3.git Merge pull request #1624 in SNORT/snort3 from ~BBANTWAL/snort3:fix_async_http to master Squashed commit of the following: commit 84367e7e76a1f3bea145a3520fe729e099e0ac1a Author: Bhagya Tholpady Date: Tue May 28 12:24:11 2019 -0400 http_inspect: stop clearing http data snapshots from ips contexts on flow deletion --- diff --git a/src/service_inspectors/http_inspect/http_context_data.cc b/src/service_inspectors/http_inspect/http_context_data.cc index f079d62f5..ff6a4ba75 100644 --- a/src/service_inspectors/http_inspect/http_context_data.cc +++ b/src/service_inspectors/http_inspect/http_context_data.cc @@ -47,7 +47,6 @@ void HttpContextData::save_snapshot(HttpMsgSection* section) HttpContextData* hcd = IpsContextData::get(HttpContextData::ips_id); hcd->current_section = section; - section->add_ips_context(DetectionEngine::get_context()); } HttpMsgSection* HttpContextData::clear_snapshot(IpsContext* context) diff --git a/src/service_inspectors/http_inspect/http_msg_section.cc b/src/service_inspectors/http_inspect/http_msg_section.cc index d5b28e53d..0a50d1933 100644 --- a/src/service_inspectors/http_inspect/http_msg_section.cc +++ b/src/service_inspectors/http_inspect/http_msg_section.cc @@ -54,14 +54,6 @@ HttpMsgSection::HttpMsgSection(const uint8_t* buffer, const uint16_t buf_size, HttpContextData::save_snapshot(this); } -HttpMsgSection::~HttpMsgSection() -{ - // FIXIT-L This clear call is to handle premature deletion (before offload completes) - // of message sections due to session deletion - if ( ips_context ) - HttpContextData::clear_snapshot(ips_context); -} - bool HttpMsgSection::detection_required() const { return ((msg_text.length() > 0) && (get_inspection_section() != IS_NONE)) || @@ -269,7 +261,6 @@ void HttpMsgSection::clear() { transaction->clear_section(); cleared = true; - ips_context = nullptr; } #ifdef REG_TEST diff --git a/src/service_inspectors/http_inspect/http_msg_section.h b/src/service_inspectors/http_inspect/http_msg_section.h index 2584b533e..19d32c105 100644 --- a/src/service_inspectors/http_inspect/http_msg_section.h +++ b/src/service_inspectors/http_inspect/http_msg_section.h @@ -34,7 +34,7 @@ class HttpMsgSection { public: - virtual ~HttpMsgSection(); + virtual ~HttpMsgSection() = default; virtual HttpEnums::InspectSection get_inspection_section() const { return HttpEnums::IS_NONE; } virtual bool detection_required() const; @@ -49,8 +49,6 @@ public: { return trailer[source_id]; } virtual HttpMsgBody* get_body() { return nullptr; } - void add_ips_context(snort::IpsContext* context) { ips_context = context; } - // Minimum necessary processing for every message virtual void analyze() = 0; @@ -101,7 +99,6 @@ protected: HttpEnums::MethodId method_id; const bool tcp_close; - snort::IpsContext* ips_context = nullptr; // Pointers to related message sections in the same transaction HttpMsgRequest* request; HttpMsgStatus* status;