diff --git a/biflow_aggregator/main.cpp b/biflow_aggregator/main.cpp index 78ff6790..6b252eba 100644 --- a/biflow_aggregator/main.cpp +++ b/biflow_aggregator/main.cpp @@ -419,7 +419,7 @@ do_mainloop(Configuration& config) while (unlikely(stop == false)) { // Check timeouted flows - for (node *t_data = dll.begin(); t_data != NULL; t_data = t_data->next) { + for (node *t_data = dll.begin(); !flush_configuration.is_set() && t_data != NULL; t_data = t_data->next) { if (time_last >= t_data->value.passive_timeout) { // timeouted auto data = agg.flow_cache.find(t_data->value.key); proccess_and_send(agg, data->first, data->second, out_tmplt, out_rec); @@ -486,7 +486,7 @@ do_mainloop(Configuration& config) time_last = ur_time_get_sec(ur_get(in_tmplt, in_data, F_TIME_LAST)); // Check timeouted flows - for (node *t_data = dll.begin(); t_data != NULL; t_data = t_data->next) { + for (node *t_data = dll.begin(); !flush_configuration.is_set() && t_data != NULL; t_data = t_data->next) { if (time_first >= t_data->value.passive_timeout || time_last >= t_data->value.active_timeout) { // timeouted auto data = agg.flow_cache.find(t_data->value.key); proccess_and_send(agg, data->first, data->second, out_tmplt, out_rec); diff --git a/biflow_aggregator/tests/inputs/input2_packet_aggregation b/biflow_aggregator/tests/inputs/input2_packet_aggregation index 34fd6f24..453ba648 100644 --- a/biflow_aggregator/tests/inputs/input2_packet_aggregation +++ b/biflow_aggregator/tests/inputs/input2_packet_aggregation @@ -3,4 +3,4 @@ ipaddr DST_IP,ipaddr SRC_IP,uint32 PACKETS,time TIME_FIRST,time TIME_LAST 192.168.1.5,192.168.1.6,666,2016-10-28T17:00:3.0,2016-10-28T17:00:11.0 192.168.1.8,192.168.1.9,10,2016-10-28T17:00:13.0,2016-10-28T17:00:17.0 192.168.1.8,192.168.1.9,17,2016-10-28T17:00:21.0,2016-10-28T17:00:23.0 -192.168.1.8,192.168.1.9,53,2016-10-28T17:00:26.0,2016-10-28T17:00:41.0 +192.168.1.8,192.168.1.9,53,2016-10-28T17:00:26.0,2016-10-28T17:00:51.0 diff --git a/biflow_aggregator/tests/references/reference2_gt0 b/biflow_aggregator/tests/references/reference2_gt0 index 1d94778e..1c168c6b 100644 --- a/biflow_aggregator/tests/references/reference2_gt0 +++ b/biflow_aggregator/tests/references/reference2_gt0 @@ -1,2 +1,2 @@ 2016-10-28T17:00:01.000000,2016-10-28T17:00:23.000000,4,694 -2016-10-28T17:00:26.000000,2016-10-28T17:00:41.000000,1,53 +2016-10-28T17:00:26.000000,2016-10-28T17:00:51.000000,1,53 diff --git a/biflow_aggregator/tests/references/reference2_gt5a b/biflow_aggregator/tests/references/reference2_gt5a index eac7e949..bfcda95f 100644 --- a/biflow_aggregator/tests/references/reference2_gt5a +++ b/biflow_aggregator/tests/references/reference2_gt5a @@ -2,4 +2,4 @@ 2016-10-28T17:00:03.000000,2016-10-28T17:00:11.000000,1,666 2016-10-28T17:00:13.000000,2016-10-28T17:00:17.000000,1,10 2016-10-28T17:00:21.000000,2016-10-28T17:00:23.000000,1,17 -2016-10-28T17:00:26.000000,2016-10-28T17:00:41.000000,1,53 +2016-10-28T17:00:26.000000,2016-10-28T17:00:51.000000,1,53 diff --git a/biflow_aggregator/tests/references/reference2_gt5r b/biflow_aggregator/tests/references/reference2_gt5r index 1be870c0..74d4a06d 100644 --- a/biflow_aggregator/tests/references/reference2_gt5r +++ b/biflow_aggregator/tests/references/reference2_gt5r @@ -1,4 +1,4 @@ 2016-10-28T17:00:01.000000,2016-10-28T17:00:11.000000,2,667 2016-10-28T17:00:13.000000,2016-10-28T17:00:17.000000,1,10 2016-10-28T17:00:21.000000,2016-10-28T17:00:23.000000,1,17 -2016-10-28T17:00:26.000000,2016-10-28T17:00:41.000000,1,53 +2016-10-28T17:00:26.000000,2016-10-28T17:00:51.000000,1,53