[dovecot-cvs] dovecot/src/lib-storage/index index-storage.c, 1.110, 1.111 index-storage.h, 1.121, 1.122

tss at dovecot.org tss at dovecot.org
Tue Apr 17 19:03:49 EEST 2007


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

Modified Files:
	index-storage.c index-storage.h 
Log Message:
Map mailbox to mail_index_view, not to mail_index. Fixes crashes when the
same mailbox was opened multiple times.



Index: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- index-storage.c	30 Mar 2007 18:57:35 -0000	1.110
+++ index-storage.c	17 Apr 2007 16:03:47 -0000	1.111
@@ -333,6 +333,9 @@
 	ibox->view = mail_index_view_open(ibox->index);
 	ibox->keyword_names = mail_index_get_keywords(ibox->index);
 
+	MODULE_CONTEXT_SET_FULL(ibox->view, mail_storage_mail_index_module,
+				ibox, &ibox->view_module_ctx);
+
 	ibox->box.opened = TRUE;
 }
 
@@ -361,9 +364,6 @@
 	ibox->md5hdr_ext_idx =
 		mail_index_ext_register(ibox->index, "header-md5", 0, 16, 1);
 
-	MODULE_CONTEXT_SET_FULL(ibox->index, mail_storage_mail_index_module,
-				ibox, &ibox->index_module_ctx);
-
 	if ((flags & MAILBOX_OPEN_FAST) == 0)
 		index_storage_mailbox_open(ibox);
 }
@@ -382,7 +382,6 @@
 		buffer_free(ibox->recent_flags);
 	i_free(ibox->cache_fields);
 
-	MODULE_CONTEXT_UNSET(ibox->index, mail_storage_mail_index_module);
 	pool_unref(box->pool);
 	return 0;
 }

Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- index-storage.h	30 Mar 2007 18:57:35 -0000	1.121
+++ index-storage.h	17 Apr 2007 16:03:47 -0000	1.122
@@ -23,7 +23,7 @@
 
 struct index_mailbox {
 	struct mailbox box;
-	union mail_index_module_context index_module_ctx;
+	union mail_index_view_module_context view_module_ctx;
 
 	struct mail_storage *storage;
 	enum mailbox_open_flags open_flags;



More information about the dovecot-cvs mailing list