summaryrefslogtreecommitdiffstats
path: root/runtime/batch.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-19 18:58:33 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-19 18:58:33 +0200
commit0cf8e88a348dc574244e4f5c2be26f47e8bfff08 (patch)
tree344746e43ce112e6fae231139b809cfd430e1e98 /runtime/batch.h
parenta9c4b26d462dd3c9dbd0575a3a1acc6d8df1c3b3 (diff)
downloadrsyslog-0cf8e88a348dc574244e4f5c2be26f47e8bfff08.tar.gz
rsyslog-0cf8e88a348dc574244e4f5c2be26f47e8bfff08.tar.xz
rsyslog-0cf8e88a348dc574244e4f5c2be26f47e8bfff08.zip
solved the intended-discard-during-dequeue issue
Diffstat (limited to 'runtime/batch.h')
-rw-r--r--runtime/batch.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/batch.h b/runtime/batch.h
index eb266b3f..031718a7 100644
--- a/runtime/batch.h
+++ b/runtime/batch.h
@@ -55,9 +55,15 @@ struct batch_obj_s {
* object. We stick to the more generic term because queues may potentially hold
* other types of objects, too.
* rgerhards, 2009-05-12
+ * Note that nElem is not necessarily equal to nElemDeq. This is the case when we
+ * discard some elements (because of configuration) during dequeue processing. As
+ * all Elements are only deleted when the batch is processed, we can not immediately
+ * delete them. So we need to keep their number that we can delete them when the batch
+ * is completed (else, the whole process does not work correctly).
*/
struct batch_s {
int nElem; /* actual number of element in this entry */
+ int nElemDeq; /* actual number of elements dequeued (and thus to be deleted) - see comment above! */
int iDoneUpTo; /* all messages below this index have state other than RDY */
qDeqID deqID; /* ID of dequeue operation that generated this batch */
batch_obj_t *pElem; /* batch elements */