[dovecot-cvs] dovecot/src/lib-index mail-index-sync-update.c, 1.71, 1.72 mail-index-view-sync.c, 1.32, 1.33 mail-index.c, 1.178, 1.179

cras at dovecot.org cras at dovecot.org
Sun Dec 5 03:47:06 EET 2004


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv16734/lib-index

Modified Files:
	mail-index-sync-update.c mail-index-view-sync.c mail-index.c 
Log Message:
Added more asserts.



Index: mail-index-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-update.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- mail-index-sync-update.c	5 Dec 2004 01:41:45 -0000	1.71
+++ mail-index-sync-update.c	5 Dec 2004 01:47:03 -0000	1.72
@@ -1040,6 +1040,8 @@
 		i_unreached();
 	}
 
+	i_assert(ctx->view->map->records_count ==
+		 ctx->view->map->hdr.messages_count);
 	return ret;
 }
 

Index: mail-index-view-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-view-sync.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- mail-index-view-sync.c	29 Nov 2004 00:48:45 -0000	1.32
+++ mail-index-view-sync.c	5 Dec 2004 01:47:03 -0000	1.33
@@ -164,6 +164,8 @@
 				     &view->hdr, sizeof(view->hdr));
 			map->hdr = view->hdr;
 		}
+
+		i_assert(map->records_count == map->hdr.messages_count);
 	}
 
 	mail_index_view_unref_maps(view);

Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- mail-index.c	5 Dec 2004 01:45:53 -0000	1.178
+++ mail-index.c	5 Dec 2004 01:47:03 -0000	1.179
@@ -732,6 +732,7 @@
 	i_assert(index->lock_type != F_UNLCK);
 
 	if (!force && index->map != NULL) {
+		i_assert(index->hdr != NULL);
 		ret = mail_index_map_try_existing(index->map);
 		if (ret != 0)
 			return ret;
@@ -780,6 +781,8 @@
 		ret = mail_index_mmap(index, map);
 	else
 		ret = mail_index_read_map_with_retry(index, &map, force);
+	i_assert(index->map == NULL);
+
 	if (ret <= 0) {
 		mail_index_unmap_forced(index, map);
 		return ret;
@@ -795,6 +798,7 @@
 
 	index->hdr = &map->hdr;
 	index->map = map;
+	i_assert(map->hdr.messages_count == map->records_count);
 	return 1;
 }
 



More information about the dovecot-cvs mailing list