diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-15 16:39:36 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-15 16:39:36 +0200 |
commit | 34a88a7e9a9501593b6fe9f79cc96963c4da7cde (patch) | |
tree | df742c45987b068beeb12e1cdac8996edd79a86e /plugins/imudp/imudp.c | |
parent | 6ab4666622efeb9944bbf7b6e3581d1372465adb (diff) | |
download | rsyslog-34a88a7e9a9501593b6fe9f79cc96963c4da7cde.tar.gz rsyslog-34a88a7e9a9501593b6fe9f79cc96963c4da7cde.tar.bz2 rsyslog-34a88a7e9a9501593b6fe9f79cc96963c4da7cde.zip |
ratelimit: added linux-like ratelimiter type
Diffstat (limited to 'plugins/imudp/imudp.c')
-rw-r--r-- | plugins/imudp/imudp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index 7f9e00dc..aba7d69d 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -223,7 +223,7 @@ addListner(instanceConf_t *inst) struct lstn_s *newlcnfinfo; uchar *bindName; uchar *port; - uchar statname[64]; + uchar dispname[64]; /* check which address to bind to. We could do this more compact, but have not * done so in order to make the code more readable. -- rgerhards, 2007-12-27 @@ -248,12 +248,12 @@ addListner(instanceConf_t *inst) newlcnfinfo->next = NULL; newlcnfinfo->sock = newSocks[iSrc]; newlcnfinfo->pRuleset = inst->pBindRuleset; - CHKiRet(ratelimitNew(&newlcnfinfo->ratelimiter)); + snprintf((char*)dispname, sizeof(dispname), "imudp(%s:%s)", bindName, port); + dispname[sizeof(dispname)-1] = '\0'; /* just to be on the save side... */ + CHKiRet(ratelimitNew(&newlcnfinfo->ratelimiter, dispname, NULL)); /* support statistics gathering */ CHKiRet(statsobj.Construct(&(newlcnfinfo->stats))); - snprintf((char*)statname, sizeof(statname), "imudp(%s:%s)", bindName, port); - statname[sizeof(statname)-1] = '\0'; /* just to be on the save side... */ - CHKiRet(statsobj.SetName(newlcnfinfo->stats, statname)); + CHKiRet(statsobj.SetName(newlcnfinfo->stats, dispname)); STATSCOUNTER_INIT(newlcnfinfo->ctrSubmit, newlcnfinfo->mutCtrSubmit); CHKiRet(statsobj.AddCounter(newlcnfinfo->stats, UCHAR_CONSTANT("submitted"), ctrType_IntCtr, &(newlcnfinfo->ctrSubmit))); |