]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
minor refactors
authorTom Peters <thopeter@cisco.com>
Wed, 10 Dec 2014 19:41:23 +0000 (14:41 -0500)
committerTom Peters <thopeter@cisco.com>
Wed, 10 Dec 2014 19:41:23 +0000 (14:41 -0500)
src/service_inspectors/nhttp_inspect/nhttp_flow_data.h
src/service_inspectors/nhttp_inspect/nhttp_inspect.cc
src/service_inspectors/nhttp_inspect/nhttp_inspect.h

index cd5a8d3103a965c9cd1b294c5fe39d77dd8ffecd..27ab2608eb0ca886cd38b2b18e42e2f8d1577181 100644 (file)
@@ -56,8 +56,6 @@ private:
     NHttpStartSplitter start_splitter[2];
     NHttpHeaderSplitter header_splitter[2];
     NHttpChunkSplitter chunk_splitter[2];
-    uint32_t unused_octets_visible[2] = { 0, 0 };
-    uint32_t header_octets_visible[2] = { 0, 0 };
     uint8_t *section_buffer[2] = { nullptr, nullptr };
     int32_t section_buffer_length[2] = { 0, 0 };
     bool section_buffer_owned[2] = { true, true };
@@ -72,17 +70,19 @@ private:
     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 };
+    uint32_t header_octets_visible[2] = { 0, 0 };
 
     // 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 };
     NHttpEnums::MethodId method_id = NHttpEnums::METH__NOTPRESENT;
     int32_t status_code_num = NHttpEnums::STAT_NOTPRESENT;
 
-    int64_t body_octets[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT };   // number of user data octets seen so far (regular body or chunks)
+    int64_t body_octets[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // number of user data octets seen so far (regular body or chunks)
 
     // Transaction management including pipelining
     NHttpTransaction* transaction[2] = { nullptr, nullptr };
index c3059fa18970ac602c724a5015abaf1c032fdfa9..8d7c761d04eca914db3dbf89e232a100eb2338dd 100644 (file)
@@ -78,7 +78,7 @@ bool NHttpInspect::get_buf(unsigned id, Packet*, InspectionBuffer& b)
 }
 
 ProcessResult NHttpInspect::process(const uint8_t* data, const uint16_t dsize, Flow* const flow, SourceId source_id,
-   bool buf_owner)
+   bool buf_owner) const
 {
     NHttpFlowData* session_data = (NHttpFlowData*)flow->get_application_data(NHttpFlowData::nhttp_flow_id);
     assert(session_data != nullptr);
index 93aadf8c6dc1f3a715d892ed951f6f9c0ffadd0a..235e5a4e977e1b75c489fcefd5e78f27651eff2e 100644 (file)
@@ -50,7 +50,7 @@ private:
     friend NHttpStreamSplitter;
 
     NHttpEnums::ProcessResult process(const uint8_t* data, const uint16_t dsize, Flow* const flow,
-       NHttpEnums::SourceId source_id_, bool buf_owner);
+       NHttpEnums::SourceId source_id_, bool buf_owner) const;
 };
 
 #endif