summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-19 09:41:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-19 09:41:45 +0200
commit90e8475260cf8ac54519b3d964d879489af879f6 (patch)
treecf072344f5a41b2485f6ad320c408d4f5fe0d903 /action.c
parenta4344f350151cdb9172897709fa08680ec8587ba (diff)
downloadrsyslog-90e8475260cf8ac54519b3d964d879489af879f6.tar.gz
rsyslog-90e8475260cf8ac54519b3d964d879489af879f6.tar.xz
rsyslog-90e8475260cf8ac54519b3d964d879489af879f6.zip
bugfix: message processing states were not set correctly in all cases
however, this had no negative effect, as the message processing state was not evaluated when a batch was deleted, and that was the only case where the state could be wrong.
Diffstat (limited to 'action.c')
-rw-r--r--action.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/action.c b/action.c
index 5bd175e5..58658ac1 100644
--- a/action.c
+++ b/action.c
@@ -821,12 +821,12 @@ tryDoAction(action_t *pAction, batch_t *pBatch, int *pnElem)
DBGPRINTF("action call returned %d\n", localRet);
if(localRet == RS_RET_OK) {
/* mark messages as committed */
- while(iCommittedUpTo < i) {
+ while(iCommittedUpTo <= i) {
pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM;
}
} else if(localRet == RS_RET_PREVIOUS_COMMITTED) {
/* mark messages as committed */
- while(iCommittedUpTo < i - 1) {
+ while(iCommittedUpTo < i) {
pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM;
}
pBatch->pElem[i].state = BATCH_STATE_SUB;
@@ -838,6 +838,7 @@ tryDoAction(action_t *pAction, batch_t *pBatch, int *pnElem)
iRet = localRet;
FINALIZE;
}
+dbgprintf("XXX: submitBatch set element %d state to %d\n", i, pBatch->pElem[i].state);
}
++i;
++iElemProcessed;
@@ -871,6 +872,7 @@ submitBatch(action_t *pAction, batch_t *pBatch, int nElem)
bDone = 0;
do {
+dbgprintf("XXX: submitBatch in loop, batch size %d\n", nElem);
localRet = tryDoAction(pAction, pBatch, &nElem);
if( localRet == RS_RET_OK
|| localRet == RS_RET_PREVIOUS_COMMITTED