From 4e0c339586c5d6741434266810f7f75e632b03ce Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Fri, 12 Apr 2013 10:09:33 +0200 Subject: 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. --- runtime/ratelimit.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/ratelimit.h') 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); -- cgit v1.2.3