diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-12-20 14:10:50 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-12-20 14:10:50 +0100 |
commit | b83e124aa772347a5b2f7d010dcc6f12b056a0a0 (patch) | |
tree | a0a1a84527b6af9595136a7ae8bf72b9985b49a9 /runtime/ruleset.c | |
parent | 1a040708160cb23a899e320a456957f5392a144f (diff) | |
parent | cac0a1efdc9ce79b4503431d07075b932a6dcdb2 (diff) | |
download | rsyslog-b83e124aa772347a5b2f7d010dcc6f12b056a0a0.tar.gz rsyslog-b83e124aa772347a5b2f7d010dcc6f12b056a0a0.tar.bz2 rsyslog-b83e124aa772347a5b2f7d010dcc6f12b056a0a0.zip |
Merge branch 'v7-stable' into v7-stable-libnet-frag
Conflicts:
plugins/omudpspoof/omudpspoof.c
Diffstat (limited to 'runtime/ruleset.c')
-rw-r--r-- | runtime/ruleset.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/runtime/ruleset.c b/runtime/ruleset.c index 3459f545..b74f8ec8 100644 --- a/runtime/ruleset.c +++ b/runtime/ruleset.c @@ -299,7 +299,9 @@ execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) sbool bRet; DEFiRet; newAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + FINALIZE; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ if(active == NULL || active[i]) { @@ -315,13 +317,16 @@ execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) scriptExec(stmt->d.s_if.t_then, pBatch, newAct); } if(stmt->d.s_if.t_else != NULL) { - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) - ; ++i) + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + FINALIZE; if(pBatch->pElem[i].state != BATCH_STATE_DISC) newAct[i] = !newAct[i]; + } scriptExec(stmt->d.s_if.t_else, pBatch, newAct); } freeActive(newAct); +finalize_it: RETiRet; } @@ -334,7 +339,9 @@ execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) int bRet; int i; newAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ pMsg = (msg_t*)(pBatch->pElem[i].pUsrp); @@ -355,10 +362,12 @@ execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) scriptExec(stmt->d.s_prifilt.t_then, pBatch, newAct); } if(stmt->d.s_prifilt.t_else != NULL) { - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) - ; ++i) + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state != BATCH_STATE_DISC) newAct[i] = !newAct[i]; + } scriptExec(stmt->d.s_prifilt.t_else, pBatch, newAct); } freeActive(newAct); @@ -461,7 +470,9 @@ execPROPFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) sbool bRet; int i; thenAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ if(active == NULL || active[i]) { |