summaryrefslogtreecommitdiff
path: root/nDPId-test.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-11-13 13:52:42 +0100
committerToni Uhlig <matzeton@googlemail.com>2023-11-13 13:52:42 +0100
commit82934b7271ad11332cdc291188e6b51e9534c301 (patch)
tree6f48d177a1a047878c54db75b9945aa0e3242eea /nDPId-test.c
parent4920b2a4be62b85b6355278fe0d63637bddb624f (diff)
Fixed clang-tidy warnings.
* fixed/improved c-captured logging Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPId-test.c')
-rw-r--r--nDPId-test.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/nDPId-test.c b/nDPId-test.c
index 8f69350f9..f5c6a7ed7 100644
--- a/nDPId-test.c
+++ b/nDPId-test.c
@@ -479,7 +479,7 @@ static enum nDPIsrvd_callback_return update_flow_packets_processed(struct nDPIsr
return CALLBACK_ERROR;
}
- if (sock->flow_user_data_size > 0)
+ if (flow_stats != NULL && sock->flow_user_data_size > 0)
{
flow_stats->total_packets_processed = 0;
}
@@ -513,7 +513,7 @@ static enum nDPIsrvd_callback_return update_flow_l4_payload_len(struct nDPIsrvd_
struct nDPIsrvd_json_token const * const flow_total_l4_payload_len[FD_COUNT] = {
TOKEN_GET_SZ(sock, "flow_src_tot_l4_payload_len"), TOKEN_GET_SZ(sock, "flow_dst_tot_l4_payload_len")};
- if (sock->flow_user_data_size > 0)
+ if (flow_stats != NULL && sock->flow_user_data_size > 0)
{
flow_stats->flow_total_l4_data_len = 0;
}
@@ -586,7 +586,7 @@ static enum nDPIsrvd_callback_return distributor_json_callback(struct nDPIsrvd_s
{
instance_stats->daemon_event_count++;
}
- if (sock->thread_user_data_size > 0)
+ if (thread_stats != NULL && sock->thread_user_data_size > 0)
{
thread_stats->daemon_event_count++;
}
@@ -687,7 +687,7 @@ static enum nDPIsrvd_callback_return distributor_json_callback(struct nDPIsrvd_s
{
global_stats->cur_active_flows++;
global_stats->flow_new_count++;
- if (sock->thread_user_data_size > 0)
+ if (thread_stats != NULL && sock->thread_user_data_size > 0)
{
thread_stats->flow_new_count++;
}
@@ -707,7 +707,7 @@ static enum nDPIsrvd_callback_return distributor_json_callback(struct nDPIsrvd_s
global_stats->cur_active_flows--;
global_stats->cur_idle_flows++;
global_stats->flow_end_count++;
- if (sock->thread_user_data_size > 0)
+ if (thread_stats != NULL && sock->thread_user_data_size > 0)
{
thread_stats->flow_end_count++;
}
@@ -723,7 +723,7 @@ static enum nDPIsrvd_callback_return distributor_json_callback(struct nDPIsrvd_s
global_stats->cur_active_flows--;
global_stats->cur_idle_flows++;
global_stats->flow_idle_count++;
- if (sock->thread_user_data_size > 0)
+ if (thread_stats != NULL && sock->thread_user_data_size > 0)
{
thread_stats->flow_idle_count++;
}