summaryrefslogtreecommitdiffstats
path: root/runtime/ratelimit.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-15 17:01:00 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-15 17:01:00 +0200
commitcfa8d01f52c96b18e17fb905092788ad520b39ac (patch)
tree83853915c8a29529bf6cff6cd06d431a798ee9e3 /runtime/ratelimit.c
parent34a88a7e9a9501593b6fe9f79cc96963c4da7cde (diff)
downloadrsyslog-cfa8d01f52c96b18e17fb905092788ad520b39ac.tar.gz
rsyslog-cfa8d01f52c96b18e17fb905092788ad520b39ac.tar.bz2
rsyslog-cfa8d01f52c96b18e17fb905092788ad520b39ac.zip
imptcp: support for Linux-Type ratelimiting added
Diffstat (limited to 'runtime/ratelimit.c')
-rw-r--r--runtime/ratelimit.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/runtime/ratelimit.c b/runtime/ratelimit.c
index 22e785a8..24152e8d 100644
--- a/runtime/ratelimit.c
+++ b/runtime/ratelimit.c
@@ -193,7 +193,7 @@ ratelimitMsg(ratelimit_t *ratelimit, msg_t *pMsg, msg_t **ppRepMsg)
DEFiRet;
*ppRepMsg = NULL;
- if(ratelimit->bLinuxLike) {
+ if(ratelimit->interval) {
if(withinRatelimit(ratelimit, pMsg->ttGenTime) == 0)
ABORT_FINALIZE(RS_RET_DISCARDMSG);
}
@@ -208,7 +208,7 @@ finalize_it:
int
ratelimitChecked(ratelimit_t *ratelimit)
{
- return ratelimit->bLinuxLike || ratelimit->bReduceRepeatMsgs;
+ return ratelimit->interval || ratelimit->bReduceRepeatMsgs;
}
@@ -274,8 +274,6 @@ ratelimitNew(ratelimit_t **ppThis, char *modname, char *dynname)
pThis->name = strdup(namebuf);
}
pThis->bReduceRepeatMsgs = runConf->globals.bReduceRepeatMsgs;
- if(pThis->bReduceRepeatMsgs)
- pThis->bActive = 1;
*ppThis = pThis;
finalize_it:
RETiRet;
@@ -291,7 +289,6 @@ ratelimitSetLinuxLike(ratelimit_t *ratelimit, unsigned short interval, unsigned
ratelimit->done = 0;
ratelimit->missed = 0;
ratelimit->begin = 0;
- ratelimit->bLinuxLike = 1;
}