Use define instead of magic number for pmq's per detect thread

pull/343/head
Victor Julien 12 years ago
parent 0fa38c13d1
commit eb11280888

@ -1069,7 +1069,7 @@ static TmEcode ThreadCtxDoInit (DetectEngineCtx *de_ctx, DetectEngineThreadCtx *
PatternMatchThreadPrepare(&det_ctx->mtcu, de_ctx->mpm_matcher, DetectUricontentMaxId(de_ctx));
PmqSetup(&det_ctx->pmq, 0, de_ctx->max_fp_id);
for (i = 0; i < 256; i++) {
for (i = 0; i < DETECT_SMSG_PMQ_NUM; i++) {
PmqSetup(&det_ctx->smsg_pmq[i], 0, de_ctx->max_fp_id);
}
@ -1196,7 +1196,7 @@ TmEcode DetectEngineThreadCtxDeinit(ThreadVars *tv, void *data) {
PmqFree(&det_ctx->pmq);
int i;
for (i = 0; i < 256; i++) {
for (i = 0; i < DETECT_SMSG_PMQ_NUM; i++) {
PmqFree(&det_ctx->smsg_pmq[i]);
}

@ -734,6 +734,8 @@ typedef struct HttpReassembledBody_ {
} HttpReassembledBody;
#define DETECT_FILESTORE_MAX 15
/** \todo review how many we actually need here */
#define DETECT_SMSG_PMQ_NUM 256
/**
* Detection engine thread data.
@ -805,7 +807,7 @@ typedef struct DetectionEngineThreadCtx_ {
MpmThreadCtx mtcu; /**< thread ctx for uricontent mpm */
MpmThreadCtx mtcs; /**< thread ctx for stream mpm */
PatternMatcherQueue pmq;
PatternMatcherQueue smsg_pmq[256];
PatternMatcherQueue smsg_pmq[DETECT_SMSG_PMQ_NUM];
/** ip only rules ctx */
DetectEngineIPOnlyThreadCtx io_ctx;

Loading…
Cancel
Save