summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-03-14 13:51:18 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-03-14 13:51:18 +0100
commit7d516b0a6c46177c18aea30b4617f1d2712d48fd (patch)
tree34332bbd36a1cff4fa7c1d5c7a9696672889017b /plugins
parente482c13b50b8723f433bc3ff594f28cb2a070818 (diff)
downloadrsyslog-7d516b0a6c46177c18aea30b4617f1d2712d48fd.tar.gz
rsyslog-7d516b0a6c46177c18aea30b4617f1d2712d48fd.tar.xz
rsyslog-7d516b0a6c46177c18aea30b4617f1d2712d48fd.zip
added missing initialization of stats counters
this was necessary due to refactoring of the stats subsystem ... but should have been done in the first place when this code was written. Thanks to Kaiwang Chen for his analysis of the stats subsystem, which ultimately lead to this patch!
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imptcp/imptcp.c1
-rw-r--r--plugins/imudp/imudp.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c
index e191c64f..9c6c64e4 100644
--- a/plugins/imptcp/imptcp.c
+++ b/plugins/imptcp/imptcp.c
@@ -775,6 +775,7 @@ addLstn(ptcpsrv_t *pSrv, int sock, int isIPv6)
isIPv6 ? "IPv6" : "IPv4");
statname[sizeof(statname)-1] = '\0'; /* just to be on the save side... */
CHKiRet(statsobj.SetName(pLstn->stats, statname));
+ STATSCOUNTER_INIT(pLstn->ctrSubmit, pLstn->mutCtrSubmit);
CHKiRet(statsobj.AddCounter(pLstn->stats, UCHAR_CONSTANT("submitted"),
ctrType_IntCtr, &(pLstn->ctrSubmit)));
CHKiRet(statsobj.ConstructFinalize(pLstn->stats));
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 112738b4..46631e97 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -234,6 +234,7 @@ static rsRetVal addListner(void __attribute__((unused)) *pVal, uchar *pNewVal)
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));
+ STATSCOUNTER_INIT(newlcnfinfo->ctrSubmit, newlcnfinfo->mutCtrSubmit);
CHKiRet(statsobj.AddCounter(newlcnfinfo->stats, UCHAR_CONSTANT("submitted"),
ctrType_IntCtr, &(newlcnfinfo->ctrSubmit)));
CHKiRet(statsobj.ConstructFinalize(newlcnfinfo->stats));