threshold: fix handling of multiple threshold.

This patch fixes the unittest and may fix the real work.
remotes/origin/master-1.1.x
Eric Leblond 14 years ago committed by Victor Julien
parent 142fe6e4b6
commit ba9fb53461

@ -74,16 +74,18 @@ static int PacketAlertHandle(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det
SCReturnInt(1);
}
while ((td = SigGetThresholdTypeIter(s, p, &sm))) {
do {
td = SigGetThresholdTypeIter(s, p, &sm);
if (td != NULL) {
SCLogDebug("td %p", td);
ret = PacketAlertThreshold(de_ctx, det_ctx, td, p, s);
if (ret == 0) {
/* It doesn't match threshold, remove it */
PacketAlertRemove(p, pos);
/* no need to iterate */
break;
}
}
} while (sm != NULL);
SCReturnInt(ret);
}

Loading…
Cancel
Save