From 2547716dbce89172e3d0c3738a59d2e1489bbaa2 Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Mon, 10 Jun 2013 23:09:38 +0200 Subject: 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. --- runtime/ratelimit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ratelimit.c') diff --git a/runtime/ratelimit.c b/runtime/ratelimit.c index ec248550..443a5fa6 100644 --- a/runtime/ratelimit.c +++ b/runtime/ratelimit.c @@ -128,8 +128,8 @@ tellLostCnt(ratelimit_t *ratelimit) snprintf((char*)msgbuf, sizeof(msgbuf), "%s: %u messages lost due to rate-limiting", ratelimit->name, ratelimit->missed); - logmsgInternal(RS_RET_RATE_LIMITED, LOG_SYSLOG|LOG_INFO, msgbuf, 0); ratelimit->missed = 0; + logmsgInternal(RS_RET_RATE_LIMITED, LOG_SYSLOG|LOG_INFO, msgbuf, 0); } } -- cgit v1.2.3