[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c, 1.49, 1.50 index-storage.h, 1.74, 1.75

cras at dovecot.org cras at dovecot.org
Mon Aug 23 17:41:08 EEST 2004


Update of /home/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv15130/lib-storage/index

Modified Files:
	index-mail.c index-storage.h 
Log Message:
We shouldn't try to use cached header physical_size for mboxes because it
changes.



Index: index-mail.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- index-mail.c	15 Aug 2004 03:40:32 -0000	1.49
+++ index-mail.c	23 Aug 2004 14:41:06 -0000	1.50
@@ -244,11 +244,14 @@
 		data->parts = get_cached_parts(mail);
 
 	if (data->parts != NULL) {
-		data->hdr_size = data->parts->header_size;
+		if (!mail->ibox->unreliable_headers) {
+			/* headers don't change, physical_size is reliable */
+			data->hdr_size_set = TRUE;
+			data->hdr_size = data->parts->header_size;
+		}
 		data->body_size = data->parts->body_size;
-		data->hdr_size_set = TRUE;
 		data->body_size_set = TRUE;
-		data->size = data->hdr_size.virtual_size +
+		data->size = data->parts->header_size.virtual_size +
 			data->body_size.virtual_size;
 	}
 

Index: index-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- index-storage.h	18 Jul 2004 02:25:07 -0000	1.74
+++ index-storage.h	23 Aug 2004 14:41:06 -0000	1.75
@@ -98,6 +98,7 @@
 	unsigned int notify_pending:1;
 	unsigned int mail_read_mmaped:1;
 	unsigned int syncing_commit:1;
+	unsigned int unreliable_headers:1;
 };
 
 struct index_transaction_context {



More information about the dovecot-cvs mailing list