Commit 32e50c00 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Fixed bug where the last quota limit was reported as the one generating a...

* Fixed bug where the last quota limit was reported as the one generating a verdict regardless of which one before it actually did

parent 65b4502d
......@@ -129,6 +129,8 @@ sub check {
# Loop with quotas
foreach my $quota (@{$quotas}) {
# Exceeded limit
my $exceededLimit;
# Last if we've exceeded
last if ($hasExceeded);
......@@ -183,6 +185,7 @@ sub check {
# Check for violation
if ($qtrack->{'Counter'} > $limit->{'CounterLimit'}) {
$hasExceeded = "Policy rejection; Message count quota exceeded";
$exceededLimit = $limit;
}
# Bump up limit
$newCounters{$qtrack->{'QuotasLimitsID'}}++;
......@@ -192,6 +195,7 @@ sub check {
# Check for violation
if ($qtrack->{'Counter'} > $limit->{'CounterLimit'}) {
$hasExceeded = "Policy rejection; Cumulative message size quota exceeded";
$exceededLimit = $limit;
}
}
......@@ -213,11 +217,11 @@ sub check {
# Setup some stuff we need for logging
$qtrack->{'DBKey'} = $key;
$qtrack->{'CounterLimit'} = $limit->{'CounterLimit'};
$qtrack->{'LimitType'} = $limit->{'Type'};
$qtrack->{'CounterLimit'} = $exceededLimit->{'CounterLimit'};
$qtrack->{'LimitType'} = $exceededLimit->{'Type'};
$qtrack->{'PolicyID'} = $policyID;
$qtrack->{'QuotaID'} = $quota->{'ID'};
$qtrack->{'LimitID'} = $limit->{'ID'};
$qtrack->{'LimitID'} = $exceededLimit->{'ID'};
$qtrack->{'Verdict'} = $quota->{'Verdict'};
$qtrack->{'VerdictData'} = $quota->{'Data'};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment