summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-06-21 15:11:21 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-06-21 15:11:21 +0200
commit242c263dc2eaa5c148d481503dae0498ee626103 (patch)
tree3d64994a124fdc5b9346c4bfef4e4d8938d50603 /action.c
parentd5f78989d8fd2a3c11fd1e6ed1cd4d688b1e6728 (diff)
parent86225089f2d0e82deb368e1688464e8ba84d24cf (diff)
downloadrsyslog-242c263dc2eaa5c148d481503dae0498ee626103.tar.gz
rsyslog-242c263dc2eaa5c148d481503dae0498ee626103.tar.xz
rsyslog-242c263dc2eaa5c148d481503dae0498ee626103.zip
Merge branch 'v5-stable' into v5-devel
Conflicts: ChangeLog configure.ac doc/manual.html
Diffstat (limited to 'action.c')
-rw-r--r--action.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/action.c b/action.c
index b60e5f70..5940fa97 100644
--- a/action.c
+++ b/action.c
@@ -984,11 +984,13 @@ dbgprintf("XXXXX: tryDoAction %p, pnElem %d, nElem %d\n", pAction, *pnElem,
if(localRet == RS_RET_OK) {
/* mark messages as committed */
while(iCommittedUpTo <= i) {
+ pBatch->pElem[iCommittedUpTo].bPrevWasSuspended = 0; /* we had success! */
pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM;
}
} else if(localRet == RS_RET_PREVIOUS_COMMITTED) {
/* mark messages as committed */
while(iCommittedUpTo < i) {
+ pBatch->pElem[iCommittedUpTo].bPrevWasSuspended = 0; /* we had success! */
pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM;
}
pBatch->pElem[i].state = BATCH_STATE_SUB;
@@ -1568,6 +1570,9 @@ doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch)
}
if(pBatch->pElem[i].bFilterOK)
bNeedSubmit = 1;
+ DBGPRINTF("action %p[%d]: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n",
+ pAction, i, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state,
+ pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended);
}
if(bNeedSubmit) {
iRet = qqueueEnqObjDirectBatch(pAction->pQueue, pBatch);
@@ -1576,6 +1581,9 @@ doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch)
}
if(bModifiedFilter) {
for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ DBGPRINTF("action %p: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n",
+ pAction, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state,
+ pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended);
/* note: clang static code analyzer reports a false positive below */
pBatch->pElem[i].bFilterOK = pFilterSave[i];
}
@@ -1599,21 +1607,17 @@ doSubmitToActionQBatch(action_t *pAction, batch_t *pBatch)
int i;
DEFiRet;
- /* TODO
- ich arbeite an dieser funktion, es müssen die verscheidenen modi geprüft werden. ausserdem
- muss geschaut werden, in welche anderen funktionen die neue Funktionalität noch eingebaut
- werden muss, bzw. ob man das an zentralerer stelle machen kann. Am besten die gesamte
- filter evaluation nochmal druchgehen (also das füllen des arrays).
- */
-
DBGPRINTF("Called action(Batch), logging to %s\n", module.GetStateName(pAction->pMod));
if(pAction->pQueue->qType == QUEUETYPE_DIRECT) {
iRet = doQueueEnqObjDirectBatch(pAction, pBatch);
- } else { /* in this case, we do single submits to the queue.
+ } else {/* in this case, we do single submits to the queue.
* TODO: optimize this, we may do at least a multi-submit!
*/
for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) {
+ DBGPRINTF("action %p: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n",
+ pAction, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state,
+ pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended);
if( pBatch->pElem[i].bFilterOK
&& pBatch->pElem[i].state != BATCH_STATE_DISC
&& (pAction->bExecWhenPrevSusp == 0 || pBatch->pElem[i].bPrevWasSuspended == 1)) {