flow recycler: unix socket support

Support starting and shutting down the flow recycler thread in the
unix socket runmode.
pull/1058/head
Victor Julien 12 years ago
parent f476732139
commit a52a4ae9d4

@ -286,15 +286,24 @@ TmEcode UnixSocketPcapFilesCheck(void *data)
SCFree(this->currentfile); SCFree(this->currentfile);
} }
this->currentfile = NULL; this->currentfile = NULL;
TmThreadKillThreadsFamily(TVT_MGMT);
TmThreadClearThreadsFamily(TVT_MGMT); /* handle graceful shutdown of the flow engine, it's helper
* threads and the packet threads */
FlowKillFlowManagerThread();
TmThreadDisableThreadsWithTMS(TM_FLAG_RECEIVE_TM | TM_FLAG_DECODE_TM); TmThreadDisableThreadsWithTMS(TM_FLAG_RECEIVE_TM | TM_FLAG_DECODE_TM);
FlowForceReassembly(); FlowForceReassembly();
TmThreadKillThreadsFamily(TVT_PPT); TmThreadKillThreadsFamily(TVT_PPT);
TmThreadClearThreadsFamily(TVT_PPT); TmThreadClearThreadsFamily(TVT_PPT);
FlowKillFlowRecyclerThread();
RunModeShutDown(); RunModeShutDown();
/* kill remaining mgt threads */
TmThreadKillThreadsFamily(TVT_MGMT);
TmThreadClearThreadsFamily(TVT_MGMT);
SCPerfReleaseResources(); SCPerfReleaseResources();
/* thread killed, we can run non thread-safe shutdown functions */
/* mgt and ppt threads killed, we can run non thread-safe
* shutdown functions */
FlowShutdown(); FlowShutdown();
HostCleanup(); HostCleanup();
StreamTcpFreeConfig(STREAM_VERBOSE); StreamTcpFreeConfig(STREAM_VERBOSE);
@ -332,6 +341,7 @@ TmEcode UnixSocketPcapFilesCheck(void *data)
RunModeInitializeOutputs(); RunModeInitializeOutputs();
RunModeDispatch(RUNMODE_PCAP_FILE, NULL, this->de_ctx); RunModeDispatch(RUNMODE_PCAP_FILE, NULL, this->de_ctx);
FlowManagerThreadSpawn(); FlowManagerThreadSpawn();
FlowRecyclerThreadSpawn();
SCPerfSpawnThreads(); SCPerfSpawnThreads();
/* Un-pause all the paused threads */ /* Un-pause all the paused threads */
TmThreadContinueThreads(); TmThreadContinueThreads();

Loading…
Cancel
Save