summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-11-26 17:35:54 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-11-26 17:35:54 +0100
commitf77dc853ed217e824d86bf8feb0c6e75cc0f230e (patch)
tree95b6b6dc8afe4ddcfb547675e67ee9fdcd5bb00c /action.c
parent809c7e3cdcba3bef8d29702f37c3c8b580c3d1bd (diff)
parente5fe270bdbcfbdd22cf9dcc71e7a83b6cc88a979 (diff)
downloadrsyslog-f77dc853ed217e824d86bf8feb0c6e75cc0f230e.tar.gz
rsyslog-f77dc853ed217e824d86bf8feb0c6e75cc0f230e.tar.xz
rsyslog-f77dc853ed217e824d86bf8feb0c6e75cc0f230e.zip
Merge branch 'beta' into master
Conflicts: ChangeLog action.c configure.ac doc/manual.html doc/rsyslog_conf_modules.html tests/sndrcv_drvr.sh
Diffstat (limited to 'action.c')
-rw-r--r--action.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/action.c b/action.c
index f2743124..925ba824 100644
--- a/action.c
+++ b/action.c
@@ -760,8 +760,9 @@ finalize_it:
* rgerhards, 2008-01-28
*/
static rsRetVal
-finishBatch(action_t *pThis)
+finishBatch(action_t *pThis, batch_t *pBatch)
{
+ int i;
DEFiRet;
ASSERT(pThis != NULL);
@@ -769,14 +770,17 @@ finishBatch(action_t *pThis)
if(pThis->eState == ACT_STATE_RDY)
FINALIZE; /* nothing to do */
-DBGPRINTF("finishBatch was called\n");
CHKiRet(actionPrepare(pThis));
if(pThis->eState == ACT_STATE_ITX) {
iRet = pThis->pMod->mod.om.endTransaction(pThis->pModData);
-DBGPRINTF("finishBatch returned %d for endTransaction\n", iRet);
+dbgprintf("XXX: finishBatch, result of endTranscation %d\n", iRet);
switch(iRet) {
case RS_RET_OK:
actionCommitted(pThis);
+ /* flag messages as committed */
+ for(i = 0 ; i < pBatch->nElem ; ++i) {
+ pBatch->pElem[i].state = BATCH_STATE_COMM;
+ }
break;
case RS_RET_SUSPENDED:
actionRetry(pThis);
@@ -844,11 +848,12 @@ tryDoAction(action_t *pAction, batch_t *pBatch, int *pnElem, int *pbShutdownImme
pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM;
}
pBatch->pElem[i].state = BATCH_STATE_SUB;
- } else if(localRet == RS_RET_PREVIOUS_COMMITTED) {
+ } else if(localRet == RS_RET_DEFER_COMMIT) {
pBatch->pElem[i].state = BATCH_STATE_SUB;
} else if(localRet == RS_RET_DISCARDMSG) {
pBatch->pElem[i].state = BATCH_STATE_DISC;
} else {
+ dbgprintf("tryDoAction: unexpected error code %d, finalizing\n", localRet);
iRet = localRet;
FINALIZE;
}
@@ -895,7 +900,7 @@ dbgprintf("submitBatch: state of tryDoAction %d\n", localRet);
/* try commit transaction, once done, we can simply do so as if
* that return state was returned from tryDoAction().
*/
- localRet = finishBatch(pAction);
+ localRet = finishBatch(pAction, pBatch); // TODO: careful, do we need the elem counter?
}
if( localRet == RS_RET_OK
@@ -945,7 +950,7 @@ processAction(action_t *pAction, batch_t *pBatch, int *pbShutdownImmediate)
assert(pBatch != NULL);
pBatch->iDoneUpTo = 0;
CHKiRet(submitBatch(pAction, pBatch, pBatch->nElem, pbShutdownImmediate));
- iRet = finishBatch(pAction);
+ iRet = finishBatch(pAction, pBatch);
finalize_it:
RETiRet;