From: Tom Peters Date: Thu, 11 Dec 2014 15:37:57 +0000 (-0500) Subject: minor edits X-Git-Tag: 3.0.0-233~1078^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=003a303584b5976e84899261c916fab2f693fd16;p=thirdparty%2Fsnort3.git minor edits --- diff --git a/src/service_inspectors/nhttp_inspect/nhttp_flow_data.h b/src/service_inspectors/nhttp_inspect/nhttp_flow_data.h index 27ab2608e..f864e97a5 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_flow_data.h +++ b/src/service_inspectors/nhttp_inspect/nhttp_flow_data.h @@ -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 }; diff --git a/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc b/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc index 2b79d10c2..bd78908a8 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc +++ b/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc @@ -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;