changeset 1025:eb80a942bd8b HEAD

Modifylog wasn't written for external changes (broken by the previous speedup)
author Timo Sirainen <tss@iki.fi>
date Thu, 23 Jan 2003 20:51:20 +0200
parents 2b7eaf2d31a1
children e147dcbb2ba6
files src/lib-index/mail-modifylog.c
diffstat 1 files changed, 23 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-modifylog.c	Thu Jan 23 05:34:00 2003 +0200
+++ b/src/lib-index/mail-modifylog.c	Thu Jan 23 20:51:20 2003 +0200
@@ -710,34 +710,35 @@
 	i_assert((*rec)->seq1 != 0);
 	i_assert((*rec)->uid1 != 0);
 
-	if (!external_change &&
-	    file->log->cache_lock_counter !=
-	    file->log->index->excl_lock_counter) {
-		switch (modifylog_have_other_users(file->log, FALSE)) {
-		case 0:
-			/* we're the only one having this log open,
-			   no need for modify log. */
-			file->log->cache_have_others = FALSE;
-			file->log->cache_lock_counter =
-				file->log->index->excl_lock_counter;
+	if (!external_change) {
+		if (file->log->cache_lock_counter !=
+		    file->log->index->excl_lock_counter) {
+			switch (modifylog_have_other_users(file->log, FALSE)) {
+			case 0:
+				/* we're the only one having this log open,
+				   no need for modify log. */
+				file->log->cache_have_others = FALSE;
+				file->log->cache_lock_counter =
+					file->log->index->excl_lock_counter;
 
+				*rec = NULL;
+				return TRUE;
+			case -1:
+				return FALSE;
+			default:
+				file->log->cache_have_others = TRUE;
+				file->log->cache_lock_counter =
+					file->log->index->excl_lock_counter;
+				break;
+			}
+		}
+
+		if (!file->log->cache_have_others) {
 			*rec = NULL;
 			return TRUE;
-		case -1:
-			return FALSE;
-		default:
-			file->log->cache_have_others = TRUE;
-			file->log->cache_lock_counter =
-				file->log->index->excl_lock_counter;
-			break;
 		}
 	}
 
-	if (!file->log->cache_have_others) {
-		*rec = NULL;
-		return TRUE;
-	}
-
 	if (file->mmap_used_length == file->mmap_full_length) {
 		if (!mail_modifylog_grow(file))
 			return FALSE;