Fixed missing deflate during flow event json serializing.

* caused by recently added serializing some nDPI data even packet processing is still ongoing

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2023-11-08 13:13:55 +01:00
parent d80ea84d2e
commit 55c8a848d3
2 changed files with 18 additions and 1 deletions

View File

@@ -213,6 +213,9 @@ set(NDPID_DEPS_INC "${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/dependencies"
"${CMAKE_SOURCE_DIR}/dependencies/jsmn"
"${CMAKE_SOURCE_DIR}/dependencies/uthash/src")
if(CMAKE_CROSSCOMPILING)
add_definitions("-DCROSS_COMPILATION=1")
endif()
if(ENABLE_MEMORY_PROFILING)
message(WARNING "ENABLE_MEMORY_PROFILING should not be used in production environments.")
add_definitions("-DENABLE_MEMORY_PROFILING=1"

16
nDPId.c
View File

@@ -2744,7 +2744,21 @@ static void jsonize_flow_event(struct nDPId_reader_thread * const reader_thread,
}
else if (flow_ext->flow_basic.state == FS_INFO)
{
struct nDPId_flow const * const flow = (struct nDPId_flow *)flow_ext;
struct nDPId_flow * const flow = (struct nDPId_flow *)flow_ext;
#ifdef ENABLE_ZLIB
if (nDPId_options.enable_zlib_compression != 0 && flow->info.detection_data_compressed_size > 0)
{
workflow->current_compression_diff -= flow->info.detection_data_compressed_size;
int ret = detection_data_inflate(flow);
if (ret <= 0)
{
workflow->current_compression_diff += flow->info.detection_data_compressed_size;
logger(1, "zLib decompression failed with error code: %d", ret);
return;
}
}
#endif
if (flow->info.detection_completed != 0)
{