diff options
author | Tomas Heinrich <theinric@redhat.com> | 2013-04-12 10:09:33 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-04-13 11:27:51 +0200 |
commit | 4e0c339586c5d6741434266810f7f75e632b03ce (patch) | |
tree | 5f8661ff06cf99b65b59484b8db04f7856c19f0b /runtime/ratelimit.h | |
parent | 2e86f78d59e3e381c35f21b1f939316065fd7907 (diff) | |
download | rsyslog-4e0c339586c5d6741434266810f7f75e632b03ce.tar.gz rsyslog-4e0c339586c5d6741434266810f7f75e632b03ce.tar.bz2 rsyslog-4e0c339586c5d6741434266810f7f75e632b03ce.zip |
bugfix: prevent a segfault if ratelimit condition is not met
Move the severity-check logic inside the ratelimiter and add a new
function ratelimitSetSeverity() to manipulate the treshold.
Currently only utilized by the imuxsock module.
Diffstat (limited to 'runtime/ratelimit.h')
-rw-r--r-- | runtime/ratelimit.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/ratelimit.h b/runtime/ratelimit.h index 820817bc..a058b069 100644 --- a/runtime/ratelimit.h +++ b/runtime/ratelimit.h @@ -26,6 +26,7 @@ struct ratelimit_s { /* support for Linux kernel-type ratelimiting */ unsigned short interval; unsigned short burst; + intTiny severity; /**< ratelimit only equal or lower severity levels (eq or higher values) */ unsigned done; unsigned missed; time_t begin; @@ -41,6 +42,7 @@ struct ratelimit_s { rsRetVal ratelimitNew(ratelimit_t **ppThis, char *modname, char *dynname); void ratelimitSetThreadSafe(ratelimit_t *ratelimit); void ratelimitSetLinuxLike(ratelimit_t *ratelimit, unsigned short interval, unsigned short burst); +void ratelimitSetSeverity(ratelimit_t *ratelimit, intTiny severity); rsRetVal ratelimitMsg(ratelimit_t *ratelimit, msg_t *pMsg, msg_t **ppRep); rsRetVal ratelimitAddMsg(ratelimit_t *ratelimit, multi_submit_t *pMultiSub, msg_t *pMsg); void ratelimitDestruct(ratelimit_t *pThis); |