summaryrefslogtreecommitdiff
path: root/nDPId-test.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-12-14 15:45:08 +0100
committerToni Uhlig <matzeton@googlemail.com>2023-12-14 15:45:08 +0100
commit71d933b0cd9b03cf3b8acf659c8b4b564ba9431d (patch)
treec667d6bf3e48073d98825d2438af36b353d16032 /nDPId-test.c
parentfbe07fd8821c1ca0f310f83913fb9d4dfac5d01a (diff)
Fixed an event issue.
* a "detection-update" event was thrown even if nothing changed * in some cases "not-detected" events were spammed if detection not completed * tell `libnDPI` how many packets per flow we want to dissect * `nDPId-test` validates total active flows in the right way Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPId-test.c')
-rw-r--r--nDPId-test.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/nDPId-test.c b/nDPId-test.c
index dd5bb97c1..16254ed60 100644
--- a/nDPId-test.c
+++ b/nDPId-test.c
@@ -571,9 +571,10 @@ static enum nDPIsrvd_callback_return distributor_json_callback(struct nDPIsrvd_s
{
global_stats->json_message_len_max = sock->buffer.json_message_length;
}
- global_stats->json_message_len_avg = (global_stats->json_message_len_avg +
- (global_stats->json_message_len_max + global_stats->json_message_len_min) / 2) /
- 2;
+ global_stats->json_message_len_avg =
+ (global_stats->json_message_len_avg +
+ (global_stats->json_message_len_max + global_stats->json_message_len_min) / 2) /
+ 2;
global_stats->total_events_deserialized++;
@@ -2035,9 +2036,9 @@ int main(int argc, char ** argv)
return 1;
}
- if (nDPId_return.total_active_flows > distributor_return.stats.flow_detected_count +
- distributor_return.stats.flow_guessed_count +
- distributor_return.stats.flow_not_detected_count)
+ if (nDPId_return.total_active_flows != distributor_return.stats.flow_detected_count +
+ distributor_return.stats.flow_guessed_count +
+ distributor_return.stats.flow_not_detected_count)
{
logger(1,
"%s: Amount of total active flows not equal to the amount of received 'detected', 'guessed and "