[dovecot-cvs] dovecot/src/lib-index mail-index-sync-update.c, 1.69, 1.70

cras at dovecot.org cras at dovecot.org
Sun Dec 5 00:04:48 EET 2004


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

Modified Files:
	mail-index-sync-update.c 
Log Message:
Expunge sync handlers were using wrong extension contexts. This may have
caused cache->locked 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.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- mail-index-sync-update.c	30 Nov 2004 09:37:33 -0000	1.69
+++ mail-index-sync-update.c	4 Dec 2004 22:04:45 -0000	1.70
@@ -39,7 +39,7 @@
 	const uint32_t *id_map;
 	struct mail_index_expunge_handler eh;
 	size_t handlers_count, id_map_size, size;
-	uint32_t ext_id;
+	uint32_t idx_ext_id, map_ext_id;
 
 	handlers = buffer_get_data(ctx->view->index->expunge_handlers,
 				   &handlers_count);
@@ -62,13 +62,14 @@
 	id_map_size /= sizeof(*id_map);
 
 	size = I_MIN(handlers_count, id_map_size);
-	for (ext_id = 0; ext_id < size; ext_id++) {
-		if (handlers[ext_id] == NULL || id_map[ext_id] == (uint32_t)-1)
+	for (idx_ext_id = 0; idx_ext_id < size; idx_ext_id++) {
+		map_ext_id = id_map[idx_ext_id];
+		if (handlers[idx_ext_id] == NULL || map_ext_id == (uint32_t)-1)
 			continue;
 
-		eh.handler = handlers[ext_id];
-		eh.context = &ctx->extra_context[ext_id];
-		eh.record_offset = extensions[id_map[ext_id]].record_offset;
+		eh.handler = handlers[idx_ext_id];
+		eh.context = &ctx->extra_context[map_ext_id];
+		eh.record_offset = extensions[map_ext_id].record_offset;
 		buffer_append(ctx->expunge_handlers, &eh, sizeof(eh));
 	}
 	ctx->expunge_handlers_set = TRUE;



More information about the dovecot-cvs mailing list