]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #103 in SNORT/snort3 from fix_a_warning_related_to_perf_profiler...
authorRuss Combs (rucombs) <rucombs@cisco.com>
Wed, 28 Oct 2015 20:57:11 +0000 (16:57 -0400)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Wed, 28 Oct 2015 20:57:11 +0000 (16:57 -0400)
Squashed commit of the following:

commit eb19a3dcfca5efe7641491ce38bc57a08cf99e85
Author: Joel Cornett <joel.cornett@gmail.com>
Date:   Wed Oct 28 16:14:35 2015 -0400

    fixed typos in nhttp, warning for perf profiling

src/detection/detection_options.cc
src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc
src/time/profiler.h

index b65dbb493dd70153dd8e7f8d1cd72db8e91d8020..7736e79da0b5a22a62fdc590433df0ab62ccc148 100644 (file)
@@ -785,8 +785,7 @@ int detection_option_node_evaluate(
 
     state->last_check.result = result;
 
-    if ( result != DETECTION_OPTION_NO_MATCH )
-        NODE_PERF_PROFILE_STOP_MATCH(node_stats);
+    NODE_PERF_PROFILE_STOP(node_stats, result != DETECTION_OPTION_NO_MATCH);
 
     return result;
 }
index 6b518231f3a32850326e1d6e4bdbfe2c8bf60891..87f122a2bb181745df0b70a33aa69b154cfcf25a 100644 (file)
@@ -167,7 +167,7 @@ void NHttpStreamSplitter::decompress_copy(uint8_t* buffer, uint32_t& body_offset
 {
     if ((compression == CMP_GZIP) || (compression == CMP_DEFLATE))
     {
-        compress_stream->next_in = (z_const Bytef*)data;
+        compress_stream->next_in = (Bytef*)data;
         compress_stream->avail_in = length;
         compress_stream->next_out = buffer + body_offset;
         compress_stream->avail_out = MAX_OCTETS - body_offset;
index b7d512286f150b73242ab0c5b343fd93272bcb11..63ae33049823547e7fa3e15d45c3e7c4195e9982 100644 (file)
@@ -277,11 +277,14 @@ using get_profile_func = ProfileStats* (*)(const char*);
 #define NODE_PERF_PROFILE_BLOCK(stats) \
     if ( NODE_PERF_PROFILE(stats) )
 
+#define NODE_PERF_PROFILE_STOP(stats, match) \
+    PERF_PROFILER_NAME(stats) .stop(match)
+
 #define NODE_PERF_PROFILE_STOP_MATCH(stats) \
-    PERF_PROFILER_NAME(stats) .stop(true)
+    NODE_PERF_PROFILE_STOP(stats, true)
 
 #define NODE_PERF_PROFILE_STOP_NO_MATCH(stats) \
-    PERF_PROFILER_NAME(stats) .stop(false)
+    NODE_PERF_PROFILE_STOP(stats, false)
 
 #define PERF_PAUSE_BLOCK(stats) \
     if ( ProfilerPause<decltype(PERF_PROFILER_NAME(stats))> \
@@ -326,6 +329,7 @@ extern THREAD_LOCAL ProfileStats metaPerfStats;
 #define PERF_PROFILE_THREAD_LOCAL_BLOCK(stats, idx)
 #define NODE_PERF_PROFILE(stats)
 #define NODE_PERF_PROFILE_BLOCK(stats)
+#define NODE_PERF_PROFILE_STOP(stats, match)
 #define NODE_PERF_PROFILE_STOP_MATCH(stats)
 #define NODE_PERF_PROFILE_STOP_NO_MATCH(stats)
 #define PERF_PAUSE_BLOCK(stats)