]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
minor edits
authorTom Peters <thopeter@cisco.com>
Thu, 11 Dec 2014 15:37:57 +0000 (10:37 -0500)
committerTom Peters <thopeter@cisco.com>
Thu, 11 Dec 2014 15:37:57 +0000 (10:37 -0500)
src/service_inspectors/nhttp_inspect/nhttp_flow_data.h
src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc

index 27ab2608eb0ca886cd38b2b18e42e2f8d1577181..f864e97a5758d0cfed0f8c931277af4adb235c10 100644 (file)
@@ -62,12 +62,12 @@ private:
     uint8_t *chunk_buffer[2] = { nullptr, nullptr };
     int32_t chunk_buffer_length[2] = { 0, 0 };
     bool chunk_buffer_owned[2] = { true, true }; // never actually false and not checked, just here to simplify code
+    bool zero_chunk[2] = { false, false };
     
     // StreamSplitter => Inspector (facts about the most recent message section)
     // 0 element refers to client request, 1 element refers to server response
     NHttpEnums::SectionType section_type[2] = { NHttpEnums::SEC__NOTCOMPUTE, NHttpEnums::SEC__NOTCOMPUTE };
     uint32_t num_excess[2] = { 0, 0 };
-    bool zero_chunk[2] = { false, false };
     bool tcp_close[2] = { false, false };
     uint64_t infractions[2] = { 0, 0 };
     uint32_t unused_octets_visible[2] = { 0, 0 };
@@ -75,7 +75,7 @@ private:
 
     // Inspector => StreamSplitter (facts about the message section that is coming next)
     NHttpEnums::SectionType type_expected[2] = { NHttpEnums::SEC_REQUEST, NHttpEnums::SEC_STATUS };
-    int64_t data_length[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // length of the data from Content-Length field      
+    int64_t data_length[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // length of the data from Content-Length field
 
     // Inspector's internal data about the current message
     NHttpEnums::VersionId version_id[2] = { NHttpEnums::VERS__NOTPRESENT, NHttpEnums::VERS__NOTPRESENT };
index 2b79d10c21ec50ddd2721393d4eed1b783255f8d..bd78908a8dfc4b6f6c05dc07197f3de9c67ad69d 100644 (file)
@@ -174,7 +174,7 @@ StreamSplitter::Status NHttpStreamSplitter::scan (Flow* flow, const uint8_t* dat
                flush_octets, length, splitter->get_num_excess(), splitter->get_zero_chunk());
             if ((type == SEC_REQUEST) || (type == SEC_STATUS)) {
                 // Look ahead to see if entire header section is already here so we can aggregate it for detection.
-                 if (session_data->header_splitter[source_id].peek(data + flush_octets, length - flush_octets) == SCAN_FOUND) {
+                if (session_data->header_splitter[source_id].peek(data + flush_octets, length - flush_octets) == SCAN_FOUND) {
                     session_data->header_octets_visible[source_id] = session_data->header_splitter[source_id].get_num_flush();
                 }
             }
@@ -285,6 +285,8 @@ const StreamBuffer* NHttpStreamSplitter::reassemble(Flow* flow, unsigned total,
             // small chunks are aggregated before processing and are kept here until the buffer is full (paf_max)
             // all the chunks in the buffer go to the inspector together. Zero-length chunk (len == 1,
             // zero_chunk == true) flushes accumulated chunks.
+            // FIXIT-M this implementation of the zero-length chunk is temporary until stream can support a zero-
+            // octet flush.
             const int32_t total_chunk_len = chunk_buffer_length + offset + len - session_data->zero_chunk[source_id];
             if ((total_chunk_len < DATABLOCKSIZE) && (!session_data->zero_chunk[source_id]) && !tcp_close) {
                 chunk_buffer_length = total_chunk_len;