stats: added unique (and friendly) name for ruleset queues
authorRainer Gerhards <rgerhards@adiscon.com>
Tue, 31 Jan 2012 16:35:41 +0000 (17:35 +0100)
committerRainer Gerhards <rgerhards@adiscon.com>
Tue, 31 Jan 2012 16:35:41 +0000 (17:35 +0100)
runtime/ruleset.c

index 5ee2a55..69968a5 100644 (file)
@@ -500,6 +500,7 @@ debugPrintAll(void)
 static rsRetVal
 rulesetCreateQueue(void __attribute__((unused)) *pVal, int *pNewVal)
 {
+       uchar *rulesetMainQName;
        DEFiRet;
 
        if(pCurrRuleset == NULL) {
@@ -518,7 +519,9 @@ rulesetCreateQueue(void __attribute__((unused)) *pVal, int *pNewVal)
                FINALIZE; /* if it is turned off, we do not need to change anything ;) */
 
        dbgprintf("adding a ruleset-specific \"main\" queue");
-       CHKiRet(createMainQueue(&pCurrRuleset->pQueue, UCHAR_CONSTANT("ruleset")));
+       rulesetMainQName = (pCurrRuleset->pszName == NULL)? UCHAR_CONSTANT("ruleset") :
+                                                           pCurrRuleset->pszName;
+       CHKiRet(createMainQueue(&pCurrRuleset->pQueue, rulesetMainQName));
 
 finalize_it:
        RETiRet;