]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3791: http2_inspect: clear flow stream_intf with flow_data
authorOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Fri, 31 Mar 2023 07:53:47 +0000 (07:53 +0000)
committerOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Fri, 31 Mar 2023 07:53:47 +0000 (07:53 +0000)
Merge in SNORT/snort3 from ~VHORBATO/snort3:http2_stream_intf to master

Squashed commit of the following:

commit 6e6662bc009fddcdd8abc4c4d506f8144847b87b
Author: vhorbato <vhorbato@cisco.com>
Date:   Fri Mar 24 19:23:41 2023 +0200

    http2_inspect: clear flow stream_intf with flow_data

src/service_inspectors/http2_inspect/http2_flow_data.cc
src/service_inspectors/http_inspect/http_flow_data.cc
src/service_inspectors/http_inspect/http_flow_data.h

index 61c569854fca159777295c9c15905f37558a69d4..f4fc989b2db25ef78b521002473eebe29dd67751 100644 (file)
@@ -98,6 +98,8 @@ Http2FlowData::~Http2FlowData()
         hi_ss[k]->go_away();
         delete[] frame_data[k];
     }
+
+    flow->stream_intf = nullptr;
 }
 
 HttpFlowData* Http2FlowData::get_hi_flow_data()
index 5b56d1669462afa09fc3e9afd1ea370fe7cfbb5a..8473d3c42eb78b89a73215c52159b091e9147a68 100644 (file)
@@ -50,7 +50,7 @@ uint64_t HttpFlowData::instance_count = 0;
 #endif
 
 HttpFlowData::HttpFlowData(Flow* flow, const HttpParaList* params_) :
-    FlowData(inspector_id), params(params_)
+    FlowData(inspector_id), params(params_), flow(flow)
 {
     static HttpFlowStreamIntf h1_stream;
 #ifdef REG_TEST
@@ -127,6 +127,9 @@ HttpFlowData::~HttpFlowData()
         discard_list = discard_list->next;
         delete tmp;
     }
+
+    if (!for_httpx)
+        flow->stream_intf = nullptr;
 }
 
 void HttpFlowData::half_reset(SourceId source_id)
index 8e2d7a47049510643312e13ebe5ad3248de5f2bd..988ab44694ef298ac8ebb793e3f1aaf759671766 100644 (file)
@@ -144,14 +144,14 @@ private:
     // *** Inspector => StreamSplitter (facts about the message section that is coming next)
     HttpCommon::SectionType type_expected[2] = { HttpCommon::SEC_REQUEST, HttpCommon::SEC_STATUS };
     bool last_request_was_connect = false;
+    bool stretch_section_to_packet[2] = { false, false };
+    bool accelerated_blocking[2] = { false, false };
     z_stream* compress_stream[2] = { nullptr, nullptr };
     uint64_t zero_nine_expected = 0;
     // length of the data from Content-Length field
     int64_t data_length[2] = { HttpCommon::STAT_NOT_PRESENT, HttpCommon::STAT_NOT_PRESENT };
     uint32_t section_size_target[2] = { 0, 0 };
     HttpEnums::CompressId compression[2] = { HttpEnums::CMP_NONE, HttpEnums::CMP_NONE };
-    bool stretch_section_to_packet[2] = { false, false };
-    bool accelerated_blocking[2] = { false, false };
 
     // *** Inspector's internal data about the current message
     struct FdCallbackContext
@@ -217,6 +217,7 @@ private:
     int64_t hx_stream_id = -1;
     HttpCommon::HXBodyState hx_body_state[2] = { HttpCommon::HX_BODY_NOT_COMPLETE,
         HttpCommon::HX_BODY_NOT_COMPLETE };
+    snort::Flow* flow;
 
 #ifdef REG_TEST
     static uint64_t instance_count;