]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #656 in SNORT/snort3 from file_work to master
authorHui Cao (huica) <huica@cisco.com>
Wed, 5 Oct 2016 18:54:33 +0000 (14:54 -0400)
committerHui Cao (huica) <huica@cisco.com>
Wed, 5 Oct 2016 18:54:33 +0000 (14:54 -0400)
Squashed commit of the following:

commit 6209eecf88de7423e8f3bb70a62b6d02c13d9b4e
Author: huica <huica@cisco.com>
Date:   Tue Oct 4 16:56:44 2016 -0400

    Update comments for http upload

src/service_inspectors/http_inspect/http_msg_body.cc
src/service_inspectors/http_inspect/http_msg_header.cc
src/service_inspectors/http_inspect/http_stream_splitter_scan.cc

index 60cbdac83c70824096d6868cf89f7b179eb07555..55f69bc677881c9a8836fcee0dc825cfee72402d 100644 (file)
@@ -140,7 +140,7 @@ void HttpMsgBody::do_file_processing()
     if (!session_data->mime_state)
     {
         FileFlows* file_flows = FileFlows::get_file_flows(flow);
-        bool download = (source_id == SRC_SERVER);
+        const bool download = (source_id == SRC_SERVER);
 
         if (file_flows->file_process(file_data.start, fp_length,
             file_position, !download))
index 6411354ebdabd4debb4f97530efe066a48f68dab..abffe42b74e8c1b61d3ecafc9bb8e678610c9a70 100644 (file)
@@ -199,6 +199,7 @@ void HttpMsgHeader::setup_file_processing()
 {
     // FIXIT-M Bidirectional file processing is problematic so we don't do it. When the library
     // fully supports it remove the outer if statement that prevents it from being done.
+    // In addition, mime_state needs to become bidirectional.
     if (session_data->file_depth_remaining[1-source_id] <= 0)
     {
         if ((session_data->file_depth_remaining[source_id] = FileService::get_max_file_depth()) < 0)
@@ -206,10 +207,11 @@ void HttpMsgHeader::setup_file_processing()
            session_data->file_depth_remaining[source_id] = 0;
            return;
         }
-        // FIXIT check boundary to make sure this is not MIME for sure
+        // FIXIT-M check boundary to make sure this is not MIME for sure
         if ((source_id == SRC_CLIENT) and (get_header_value_norm(HEAD_CONTENT_TYPE).length > 0 ))
         {
             session_data->mime_state = new MimeSession(&decode_conf, &mime_conf);
+            // FIX-H use specific header instead of classic raw header
             const Field& headers = get_classic_raw_header();
             if (headers.length > 0)
             {
index 4a3db64dadb820296e8ae63e0670c9af8af578be..1eea161a2c92761d795959b155588cd17abaaea4 100644 (file)
@@ -256,7 +256,7 @@ bool HttpStreamSplitter::finish(Flow* flow)
         if (!session_data->mime_state)
         {
             FileFlows* file_flows = FileFlows::get_file_flows(flow);
-            bool download = (source_id == SRC_SERVER);
+            const bool download = (source_id == SRC_SERVER);
             file_flows->file_process(nullptr, 0, SNORT_FILE_END, !download);
         }
         else