bugfix: prevent another endless loop in the ratelimiter

The message that reports how many messages were lost due to
ratelimiting was sent before reseting the state that led to it. If it
itself got ratelimited, this could lead to an endless loop.
This commit is contained in:
Tomas Heinrich 2013-06-10 23:09:38 +02:00 committed by Rainer Gerhards
parent 940327046c
commit 2547716dbc

View File

@ -128,8 +128,8 @@ tellLostCnt(ratelimit_t *ratelimit)
snprintf((char*)msgbuf, sizeof(msgbuf), snprintf((char*)msgbuf, sizeof(msgbuf),
"%s: %u messages lost due to rate-limiting", "%s: %u messages lost due to rate-limiting",
ratelimit->name, ratelimit->missed); ratelimit->name, ratelimit->missed);
logmsgInternal(RS_RET_RATE_LIMITED, LOG_SYSLOG|LOG_INFO, msgbuf, 0);
ratelimit->missed = 0; ratelimit->missed = 0;
logmsgInternal(RS_RET_RATE_LIMITED, LOG_SYSLOG|LOG_INFO, msgbuf, 0);
} }
} }