From 10dcb23ae5828c239a1d8518e90c7d6d9e2ea1a8 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 16 Oct 2013 17:44:01 +0200 Subject: bugfix: omelasticsearch: did not correctly initialize stats counters This usually did not lead to any problems, because they are in static memory, which is initialized to zero by the OS when the plugin is loaded. But it may cause problems especially on systems that do not support atomic instructions - in this case the associated mutexes also did not get properly initialized. --- ChangeLog | 8 +++++++- plugins/omelasticsearch/omelasticsearch.c | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b3632fe3..e3c25cb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,13 @@ Version 7.4.5 [v7.4-stable] 2013-09-?? - now requires libestr 0.1.8 as early versions had a nasty bug in string comparisons - omelasticsearch: add failed.httprequests stats counter -- bugfix omelasticsearch: correct failed.http stats counter +- bugfix: omelasticsearch: correct failed.http stats counter +- bugfix: omelasticsearch: did not correctly initialize stats counters + This usually did not lead to any problems, because they are in static + memory, which is initialized to zero by the OS when the plugin is + loaded. But it may cause problems especially on systems that do not + support atomic instructions - in this case the associated mutexes also + did not get properly initialized. - bugfix: mmanon did not detect all IP addresses in rewrite mode The problem occured if two IPs were close to each other and the first one was shrunk. diff --git a/plugins/omelasticsearch/omelasticsearch.c b/plugins/omelasticsearch/omelasticsearch.c index 5d4c97c3..240d19e6 100644 --- a/plugins/omelasticsearch/omelasticsearch.c +++ b/plugins/omelasticsearch/omelasticsearch.c @@ -1001,13 +1001,16 @@ CODEmodInit_QueryRegCFSLineHdlr /* support statistics gathering */ CHKiRet(statsobj.Construct(&indexStats)); CHKiRet(statsobj.SetName(indexStats, (uchar *)"omelasticsearch")); + STATSCOUNTER_INIT(indexSubmit, mutCtrIndexSubmit); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"submitted", ctrType_IntCtr, &indexSubmit)); + STATSCOUNTER_INIT(indexHTTPFail, mutCtrIndexHTTPFail); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.http", ctrType_IntCtr, &indexHTTPFail)); STATSCOUNTER_INIT(indexHTTPReqFail, mutCtrIndexHTTPReqFail); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.httprequests", ctrType_IntCtr, &indexHTTPReqFail)); + STATSCOUNTER_INIT(indexESFail, mutCtrIndexESFail); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.es", ctrType_IntCtr, &indexESFail)); CHKiRet(statsobj.ConstructFinalize(indexStats)); -- cgit v1.2.3