From: Russ Combs (rucombs) Date: Wed, 28 Oct 2015 20:57:11 +0000 (-0400) Subject: Merge pull request #103 in SNORT/snort3 from fix_a_warning_related_to_perf_profiler... X-Git-Tag: 3.0.0-233~756^2~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e211ac62bb20559c4e69fc21dee3f76954c670cc;p=thirdparty%2Fsnort3.git Merge pull request #103 in SNORT/snort3 from fix_a_warning_related_to_perf_profiler to master Squashed commit of the following: commit eb19a3dcfca5efe7641491ce38bc57a08cf99e85 Author: Joel Cornett Date: Wed Oct 28 16:14:35 2015 -0400 fixed typos in nhttp, warning for perf profiling --- diff --git a/src/detection/detection_options.cc b/src/detection/detection_options.cc index b65dbb493..7736e79da 100644 --- a/src/detection/detection_options.cc +++ b/src/detection/detection_options.cc @@ -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; } diff --git a/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc b/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc index 6b518231f..87f122a2b 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc +++ b/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc @@ -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; diff --git a/src/time/profiler.h b/src/time/profiler.h index b7d512286..63ae33049 100644 --- a/src/time/profiler.h +++ b/src/time/profiler.h @@ -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 \ @@ -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)