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); SCReturnInt(1);
} }
while ((td = SigGetThresholdTypeIter(s, p, &sm))) { do {
SCLogDebug("td %p", td); td = SigGetThresholdTypeIter(s, p, &sm);
ret = PacketAlertThreshold(de_ctx, det_ctx, td, p, s); if (td != NULL) {
if (ret == 0) { SCLogDebug("td %p", td);
/* It doesn't match threshold, remove it */ ret = PacketAlertThreshold(de_ctx, det_ctx, td, p, s);
PacketAlertRemove(p, pos); if (ret == 0) {
/* no need to iterate */ /* It doesn't match threshold, remove it */
break; PacketAlertRemove(p, pos);
break;
}
} }
} } while (sm != NULL);
SCReturnInt(ret); SCReturnInt(ret);
} }

Loading…
Cancel
Save