detect: use multi tenant thread init if MT enabled

pull/1608/head
Victor Julien 11 years ago
parent b653479815
commit 98d265f40b

@ -1350,6 +1350,12 @@ static TmEcode ThreadCtxDoInit (DetectEngineCtx *de_ctx, DetectEngineThreadCtx *
*/ */
TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data) TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data)
{ {
if (DetectEngineMultiTenantEnabled()) {
DetectEngineThreadCtx *mt_det_ctx = DetectEngineThreadCtxInitForMT(tv);
*data = (void *)mt_det_ctx;
return (mt_det_ctx == NULL) ? TM_ECODE_FAILED : TM_ECODE_OK;
}
/* first register the counter. In delayed detect mode we exit right after if the /* first register the counter. In delayed detect mode we exit right after if the
* rules haven't been loaded yet. */ * rules haven't been loaded yet. */
uint16_t counter_alerts = StatsRegisterCounter("detect.alert", tv); uint16_t counter_alerts = StatsRegisterCounter("detect.alert", tv);

Loading…
Cancel
Save