diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-04-27 17:59:11 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-04-27 17:59:11 +0200 |
commit | 5930014cddf4ed5a5d0970f2a3b16be002c1ce4c (patch) | |
tree | e2fe83c0c576ee285c136d500de2838b1e5b5397 | |
parent | 6093f3110306e0575d10d09807da1e6895af4eba (diff) | |
parent | 24b62834801043bf2d9560b0cca3967e5762bea1 (diff) | |
download | rsyslog-5930014cddf4ed5a5d0970f2a3b16be002c1ce4c.tar.gz rsyslog-5930014cddf4ed5a5d0970f2a3b16be002c1ce4c.tar.xz rsyslog-5930014cddf4ed5a5d0970f2a3b16be002c1ce4c.zip |
Merge branch 'v5-stable'
Conflicts:
tools/syslogd.c
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | plugins/imuxsock/imuxsock.c | 9 |
2 files changed, 13 insertions, 2 deletions
@@ -184,6 +184,11 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-03-?? closes: http://bugzilla.adiscon.com/show_bug.cgi?id=236 --------------------------------------------------------------------------- Version 5.8.1 [V5-stable] (rgerhards), 2011-04-?? +- bugfix: rate-limiting inside imuxsock did not work 100% correct + reason was that a global config variable was invalidly accessed where a + listener variable should have been used. + Also performance-improved the case when rate limiting is turned off (this + is a very unintrusive change, thus done directly to the stable version). - bugfix: $myhostname not available in RainerScript (and no error message) closes: http://bugzilla.adiscon.com/show_bug.cgi?id=233 - bugfix: doc for impstats had wrong config statements @@ -194,6 +199,7 @@ Version 5.8.1 [V5-stable] (rgerhards), 2011-04-?? - bugfix: IPv6-address could not be specified in omrelp this was due to improper parsing of ":" closes: http://bugzilla.adiscon.com/show_bug.cgi?id=250 +- bugfix(minor): improper template function call in syslogd.c --------------------------------------------------------------------------- Version 5.8.0 [V5-stable] (rgerhards), 2011-04-12 diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index e559e6a6..cbf87d7f 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -432,7 +432,8 @@ finalize_it: /* find ratelimiter to use for this message. Currently, we use the * pid, but may change to cgroup later (probably via a config switch). - * Returns NULL if not found. + * Returns NULL if not found or rate-limiting not activated for this + * listener (the latter being a performance enhancement). */ static inline rsRetVal findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl) @@ -444,6 +445,10 @@ findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl) if(cred == NULL) FINALIZE; + if(pLstn->ratelimitInterval == 0) { + *prl = NULL; + FINALIZE; + } rl = hashtable_search(pLstn->ht, &cred->pid); if(rl == NULL) { @@ -454,7 +459,7 @@ findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl) CHKmalloc(rl = malloc(sizeof(rs_ratelimit_state_t))); CHKmalloc(keybuf = malloc(sizeof(pid_t))); *keybuf = cred->pid; - initRatelimitState(rl, ratelimitInterval, pLstn->ratelimitBurst); + initRatelimitState(rl, pLstn->ratelimitInterval, pLstn->ratelimitBurst); r = hashtable_insert(pLstn->ht, keybuf, rl); if(r == 0) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); |