dovecot-1.2: mail_transaction_log_view_clear() should keep oldes...

dovecot at dovecot.org dovecot at dovecot.org
Sat May 9 19:28:39 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/a6779d086785
changeset: 9020:a6779d086785
user:      Timo Sirainen <tss at iki.fi>
date:      Sat May 09 12:28:33 2009 -0400
description:
mail_transaction_log_view_clear() should keep oldest_file_seq and newer referenced.

diffstat:

2 files changed, 6 insertions(+), 4 deletions(-)
src/lib-index/mail-transaction-log-view.c |    6 ++++--
src/lib-index/mail-transaction-log.h      |    4 ++--

diffs (30 lines):

diff -r 7ccc533e30bb -r a6779d086785 src/lib-index/mail-transaction-log-view.c
--- a/src/lib-index/mail-transaction-log-view.c	Thu May 07 15:04:12 2009 -0400
+++ b/src/lib-index/mail-transaction-log-view.c	Sat May 09 12:28:33 2009 -0400
@@ -314,8 +314,10 @@ void mail_transaction_log_view_clear(str
 	mail_transaction_log_view_unref_all(view);
 	if (mail_transaction_log_find_file(view->log, oldest_file_seq, FALSE,
 					   &file) > 0) {
-		array_append(&view->file_refs, &file, 1);
-		file->refcount++;
+		for (; file != NULL; file = file->next) {
+			array_append(&view->file_refs, &file, 1);
+			file->refcount++;
+		}
 	}
 
 	view->cur = view->head = view->tail = NULL;
diff -r 7ccc533e30bb -r a6779d086785 src/lib-index/mail-transaction-log.h
--- a/src/lib-index/mail-transaction-log.h	Thu May 07 15:04:12 2009 -0400
+++ b/src/lib-index/mail-transaction-log.h	Sat May 09 12:28:33 2009 -0400
@@ -169,8 +169,8 @@ int mail_transaction_log_view_set(struct
 				  uint32_t min_file_seq, uoff_t min_file_offset,
 				  uint32_t max_file_seq, uoff_t max_file_offset,
 				  bool *reset_r);
-/* Clear the view. Keep oldest_file_seq log referenced so we don't get
-   desynced. */
+/* Clear the view. Keep oldest_file_seq and newer log files referenced so we
+   don't get desynced. */
 void mail_transaction_log_view_clear(struct mail_transaction_log_view *view,
 				     uint32_t oldest_file_seq);
 


More information about the dovecot-cvs mailing list