]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2335 in SNORT/snort3 from ~THOPETER/snort3:nhttp141 to master
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Mon, 20 Jul 2020 12:14:42 +0000 (12:14 +0000)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Mon, 20 Jul 2020 12:14:42 +0000 (12:14 +0000)
Squashed commit of the following:

commit c5c50405c5bab73b15c5fe10c20185cf7d34e71c
Author: Tom Peters <thopeter@cisco.com>
Date:   Tue Jul 14 17:14:59 2020 -0400

    http2_inpsect: fix interaction with tool tcpclose

src/service_inspectors/http2_inspect/http2_stream_splitter.cc
src/service_inspectors/http_inspect/http_stream_splitter_finish.cc

index 8674fea244240a42e35b013e64615319ebf77195..1ad19ef984ab85b012d1ece32e5eb8b912e87e1f 100644 (file)
@@ -190,17 +190,17 @@ bool Http2StreamSplitter::finish(Flow* flow)
     Profile profile(Http2Module::get_profile_stats());
 
     Http2FlowData* session_data = (Http2FlowData*)flow->get_flow_data(Http2FlowData::inspector_id);
-    // FIXIT-M - this assert has been changed to check for null session data and return false if so
-    //           due to lack of reliable feedback to stream that scan has been called...if that is
-    //           addressed in stream reassembly rewrite this can be reverted to an assert
-    //assert(session_data != nullptr);
     if (!session_data)
         return false;
 
 #ifdef REG_TEST
     if (HttpTestManager::use_test_output(HttpTestManager::IN_HTTP2))
     {
-        if (!HttpTestManager::use_test_input(HttpTestManager::IN_HTTP2))
+        if (HttpTestManager::use_test_input(HttpTestManager::IN_HTTP2))
+        {
+            HttpTestManager::get_test_input_source()->finish();
+        }
+        else
         {
             printf("Finish from flow data %" PRIu64 " direction %d\n", session_data->seq_num,
                 source_id);
@@ -209,8 +209,11 @@ bool Http2StreamSplitter::finish(Flow* flow)
     }
 #endif
 
-    // FIXIT-E not supported yet
-    return false;
+    bool need_reassemble = false;
+
+    // Loop through all streams and call NHI finish()
+
+    return need_reassemble;
 }
 
 bool Http2StreamSplitter::init_partial_flush(Flow* flow)
index 695fdd35e8a63934231f5897eb24b5de316a6e4b..a5ca4eae9d34c03060e7b0c64e5cb07889a6dcd3 100644 (file)
@@ -41,10 +41,6 @@ bool HttpStreamSplitter::finish(Flow* flow)
     Profile profile(HttpModule::get_profile_stats());
 
     HttpFlowData* session_data = HttpInspect::http_get_flow_data(flow);
-    // FIXIT-M - this assert has been changed to check for null session data and return false if so
-    //           due to lack of reliable feedback to stream that scan has been called...if that is
-    //           addressed in stream reassembly rewrite this can be reverted to an assert
-    //assert(session_data != nullptr);
     if(!session_data)
         return false;
 
@@ -109,6 +105,7 @@ bool HttpStreamSplitter::finish(Flow* flow)
         (session_data->cutter[source_id] == nullptr)                &&
         (session_data->section_type[source_id] == SEC__NOT_COMPUTE))
     {
+        assert(!session_data->for_http2);
         // Set up to process empty header section
         uint32_t not_used;
         prepare_flush(session_data, &not_used, SEC_HEADER, 0, 0, 0, false, 0, 0);