]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1624 in SNORT/snort3 from ~BBANTWAL/snort3:fix_async_http to...
authorMichael Altizer (mialtize) <mialtize@cisco.com>
Mon, 3 Jun 2019 18:05:33 +0000 (14:05 -0400)
committerMichael Altizer (mialtize) <mialtize@cisco.com>
Mon, 3 Jun 2019 18:05:33 +0000 (14:05 -0400)
Squashed commit of the following:

commit 84367e7e76a1f3bea145a3520fe729e099e0ac1a
Author: Bhagya Tholpady <bbantwal@cisco.com>
Date:   Tue May 28 12:24:11 2019 -0400

    http_inspect: stop clearing http data snapshots from ips contexts on flow deletion

src/service_inspectors/http_inspect/http_context_data.cc
src/service_inspectors/http_inspect/http_msg_section.cc
src/service_inspectors/http_inspect/http_msg_section.h

index f079d62f5580c53b91fad7fd6d22156cf481f56b..ff6a4ba7538c4346e53b71a07ceb9356e4a6b542 100644 (file)
@@ -47,7 +47,6 @@ void HttpContextData::save_snapshot(HttpMsgSection* section)
     HttpContextData* hcd = IpsContextData::get<HttpContextData>(HttpContextData::ips_id);
 
     hcd->current_section = section;
-    section->add_ips_context(DetectionEngine::get_context());
 }
 
 HttpMsgSection* HttpContextData::clear_snapshot(IpsContext* context)
index d5b28e53d1a0fa1553810fdb660560a545e47bd2..0a50d193324cd47a0603c57312c75478777214a5 100644 (file)
@@ -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
index 2584b533e5683e533dfac64f440c41b6da3c8e0a..19d32c10522cf670c5ee7581233c6c36abad5712 100644 (file)
@@ -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;