summaryrefslogtreecommitdiffstats
path: root/runtime/rule.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-06-24 12:13:48 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2010-06-24 12:13:48 +0200
commit31fae7b93d7aa94b7b3fcbfdf101328230ea6302 (patch)
treee9efcb9247dcd1142831c14e81652e67f03bd043 /runtime/rule.c
parentf48128f34a17aae7e7b9405fe32b396db45443ca (diff)
downloadrsyslog-31fae7b93d7aa94b7b3fcbfdf101328230ea6302.tar.gz
rsyslog-31fae7b93d7aa94b7b3fcbfdf101328230ea6302.tar.xz
rsyslog-31fae7b93d7aa94b7b3fcbfdf101328230ea6302.zip
bugfix: "$ActionExecOnlyWhenPreviousIsSuspended on" was broken
Note that, as it looks, the directive was already broken in previous v5 versions. So while I solved what looked like a (intentional) regression from the performance tuning, I actually solved a previous regression as well ;) I have also added new test cases to the testbench in order to capture such problems in the future. This version does now look pretty good in shape.
Diffstat (limited to 'runtime/rule.c')
-rw-r--r--runtime/rule.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/runtime/rule.c b/runtime/rule.c
index c3c974bf..42773768 100644
--- a/runtime/rule.c
+++ b/runtime/rule.c
@@ -99,29 +99,9 @@ DEFFUNC_llExecFunc(processBatchDoActions)
action_t *pAction = (action_t*) pData;
batch_t *pBatch = (batch_t*) pParam;
- assert(pAction != NULL);
-
-#warning execonly when prev suspended functionality missing!
-#if 0 // TODO: move this to the action object
- if((pAction->bExecWhenPrevSusp == 1) && (pDoActData->bPrevWasSuspended == 0)) {
- dbgprintf("not calling action because the previous one is not suspended\n");
- ABORT_FINALIZE(RS_RET_OK);
- }
-#endif
-
+ DBGPRINTF("Processing next action\n");
iRetMod = pAction->submitToActQ(pAction, pBatch);
-#if 0 // TODO: this must be done inside the action as well!
- if(iRetMod == RS_RET_DISCARDMSG) {
- ABORT_FINALIZE(RS_RET_DISCARDMSG);
- } else if(iRetMod == RS_RET_SUSPENDED) {
- /* indicate suspension for next module to be called */
- pDoActData->bPrevWasSuspended = 1;
- } else {
- pDoActData->bPrevWasSuspended = 0;
- }
-#endif
-
RETiRet;
}
@@ -291,11 +271,15 @@ processBatch(rule_t *pThis, batch_t *pBatch)
ISOBJ_TYPE_assert(pThis, rule);
assert(pBatch != NULL);
- /* first check the filters... */
+ /* first check the filters and reset status variables */
for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) {
CHKiRet(shouldProcessThisMessage(pThis, (msg_t*)(pBatch->pElem[i].pUsrp),
&(pBatch->pElem[i].bFilterOK)));
// TODO: really abort on error? 2010-06-10
+ if(pBatch->pElem[i].bFilterOK) {
+ /* re-init only when actually needed (cache write cost!) */
+ pBatch->pElem[i].bPrevWasSuspended = 0;
+ }
}
CHKiRet(llExecFunc(&pThis->llActList, processBatchDoActions, pBatch));