summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--action.c17
-rw-r--r--configure.ac2
-rw-r--r--runtime/queue.c9
4 files changed, 28 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 501861fa..160ca370 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,6 +84,9 @@ Version 5.8.5 [V5-stable] (rgerhards/al), 2011-??-??
- bugfix: potential hang condition during tag emulation
- bugfix: too-early string termination during tag emulation
- bugfix: The NUL-Byte for the syslogtag was not copied in MsgDup (msg.c)
+- bugfix: fixed incorrect state handling for Discard Action (transactions)
+ Note: This caused all messages in a batch to be set to COMMITTED,
+ even if they were discarded.
---------------------------------------------------------------------------
Version 5.8.4 [V5-stable] (al), 2011-08-10
- bugfix: potential misadressing in property replacer
diff --git a/action.c b/action.c
index 5940fa97..dfac8d4f 100644
--- a/action.c
+++ b/action.c
@@ -985,13 +985,17 @@ dbgprintf("XXXXX: tryDoAction %p, pnElem %d, nElem %d\n", pAction, *pnElem,
/* mark messages as committed */
while(iCommittedUpTo <= i) {
pBatch->pElem[iCommittedUpTo].bPrevWasSuspended = 0; /* we had success! */
- pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM;
+ batchSetElemState(pBatch, iCommittedUpTo, BATCH_STATE_COMM);
+ ++iCommittedUpTo;
+ //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;
+ batchSetElemState(pBatch, iCommittedUpTo, BATCH_STATE_COMM);
+ ++iCommittedUpTo;
+ //pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM;
}
pBatch->pElem[i].state = BATCH_STATE_SUB;
} else if(localRet == RS_RET_DEFER_COMMIT) {
@@ -1016,6 +1020,15 @@ finalize_it:
RETiRet;
}
+/* debug aid */
+static void displayBatchState(batch_t *pBatch)
+{
+ int i;
+ for(i = 0 ; i < pBatch->nElem ; ++i) {
+ dbgprintf("XXXXX: displayBatchState2 %p[%d]: %d\n", pBatch, i, pBatch->pElem[i].state);
+ }
+}
+
/* submit a batch for actual action processing.
* The first nElem elements are processed. This function calls itself
diff --git a/configure.ac b/configure.ac
index 023a447c..5d6fe7d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[5.9.3-pre1],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[5.9.3-pre2],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff --git a/runtime/queue.c b/runtime/queue.c
index c831836d..d81c552b 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -93,6 +93,15 @@ static rsRetVal qDestructDisk(qqueue_t *pThis);
#define QUEUE_CHECKPOINT 1
#define QUEUE_NO_CHECKPOINT 0
+/* debug aid */
+static void displayBatchState(batch_t *pBatch)
+{
+ int i;
+ for(i = 0 ; i < pBatch->nElem ; ++i) {
+ dbgprintf("XXXXX: displayBatchState %p[%d]: %d\n", pBatch, i, pBatch->pElem[i].state);
+ }
+}
+
/***********************************************************************
* we need a private data structure, the "to-delete" list. As C does
* not provide any partly private data structures, we implement this