From 8d99cfe38509aeadf169ba63c0d6c841eb2ecbe3 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 24 Sep 2012 18:59:26 +0200 Subject: Clean up implementation of omdiscard-->STOP optimization --- action.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'action.c') diff --git a/action.c b/action.c index 6997f46d..ad003118 100644 --- a/action.c +++ b/action.c @@ -289,6 +289,11 @@ rsRetVal actionDestruct(action_t *pThis) DEFiRet; ASSERT(pThis != NULL); + if(!strcmp((char*)modGetName(pThis->pMod), "builtin:omdiscard")) { + /* discard actions will be optimized out */ + FINALIZE; + } + if(pThis->pQueue != NULL) { qqueueDestruct(&pThis->pQueue); } @@ -310,8 +315,8 @@ rsRetVal actionDestruct(action_t *pThis) d_free(pThis->pszName); d_free(pThis->ppTpl); +finalize_it: d_free(pThis); - RETiRet; } @@ -362,6 +367,10 @@ actionConstructFinalize(action_t *pThis, struct cnfparamvals *queueParams) ASSERT(pThis != NULL); + if(!strcmp((char*)modGetName(pThis->pMod), "builtin:omdiscard")) { + /* discard actions will be optimized out */ + FINALIZE; + } /* generate a friendly name for us action stats */ if(pThis->pszName == NULL) { snprintf((char*) pszAName, sizeof(pszAName)/sizeof(uchar), "action %d", iActionNbr); -- cgit v1.2.3