journald, ratelimit: fix inaccurate message suppression in journal_rate_limit_test() (#4291)
Currently, the ratelimit does not handle the number of suppressed messages accurately. Even though the number of messages reaches the limit, it still allows to add one extra messages to journal. This patch fixes the problem.
This commit is contained in:
parent
100a5f579d
commit
d2665e0866
|
@ -261,7 +261,7 @@ int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, u
|
|||
return 1 + s;
|
||||
}
|
||||
|
||||
if (p->num <= burst) {
|
||||
if (p->num < burst) {
|
||||
p->num++;
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue