From: Victor Julien Date: Wed, 30 Apr 2014 10:30:30 +0000 (+0200) Subject: flow: new flow queue: flow_recycle_q X-Git-Tag: suricata-2.1beta1~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e892d99827be4422dbd3c42847551eeafac80240;p=thirdparty%2Fsuricata.git flow: new flow queue: flow_recycle_q This queue will be used by the FlowManager to pass timed out flows to another thread that will do the actual cleanup. --- diff --git a/src/flow-private.h b/src/flow-private.h index fc26e04f60..bd25960b2b 100644 --- a/src/flow-private.h +++ b/src/flow-private.h @@ -78,6 +78,9 @@ FlowProto flow_proto[FLOW_PROTO_MAX]; /** spare/unused/prealloced flows live here */ FlowQueue flow_spare_q; +/** queue to pass flows to cleanup/log thread(s) */ +FlowQueue flow_recycle_q; + FlowBucket *flow_hash; FlowConfig flow_config; diff --git a/src/flow.c b/src/flow.c index 9f9e2bd4bd..b18697bd1b 100644 --- a/src/flow.c +++ b/src/flow.c @@ -304,6 +304,7 @@ void FlowInitConfig(char quiet) SC_ATOMIC_INIT(flow_memuse); SC_ATOMIC_INIT(flow_prune_idx); FlowQueueInit(&flow_spare_q); + FlowQueueInit(&flow_recycle_q); unsigned int seed = RandomTimePreseed(); /* set defaults */ @@ -470,6 +471,7 @@ void FlowShutdown(void) } (void) SC_ATOMIC_SUB(flow_memuse, flow_config.hash_size * sizeof(FlowBucket)); FlowQueueDestroy(&flow_spare_q); + FlowQueueDestroy(&flow_recycle_q); SC_ATOMIC_DESTROY(flow_prune_idx); SC_ATOMIC_DESTROY(flow_memuse);