[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-expunge.c,1.17,1.18

cras at procontrol.fi cras at procontrol.fi
Sun Oct 27 08:37:20 EET 2002


Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory danu:/tmp/cvs-serv17951/lib-storage/index/mbox

Modified Files:
	mbox-expunge.c 
Log Message:
Moved several fields from .imap.index file to .imap.index.data file. Fixed
code so that most of the fields do not need to be set when building index,
allowing the index building to be fast (just readdir()s with maildir). This
still needs some configuration and ability to update the fields whenever it
can grab exclusive lock.

Also fixed SEARCH LARGER, SMALLER and KEYWORD.



Index: mbox-expunge.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-expunge.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- mbox-expunge.c	26 Oct 2002 19:38:37 -0000	1.17
+++ mbox-expunge.c	27 Oct 2002 06:37:18 -0000	1.18
@@ -14,7 +14,8 @@
 			unsigned int seq, IBuffer *inbuf, OBuffer *outbuf,
 			int notify)
 {
-	uoff_t offset, end_offset, from_offset, copy_size, old_limit;
+	uoff_t offset, hdr_size, body_size;
+	uoff_t end_offset, from_offset, copy_size, old_limit;
 	const unsigned char *data;
 	size_t size;
 	int expunges, failed;
@@ -26,9 +27,10 @@
 		   not the fastest way maybe, but easiest.. */
 		rec = ibox->index->lookup(ibox->index, seq-1);
 		
-		if (!mbox_mail_get_start_offset(ibox->index, rec, &offset))
+		if (!mbox_mail_get_location(ibox->index, rec, &offset,
+					    &hdr_size, &body_size))
 			return FALSE;
-		end_offset = offset + rec->header_size + rec->body_size;
+		end_offset = offset + hdr_size + body_size;
 
 		/* get back to the deleted record */
 		rec = ibox->index->next(ibox->index, rec);
@@ -38,11 +40,12 @@
 
 	expunges = FALSE;
 	while (rec != NULL) {
-		if (!mbox_mail_get_start_offset(ibox->index, rec, &offset))
+		if (!mbox_mail_get_location(ibox->index, rec, &offset,
+					    &hdr_size, &body_size))
 			return FALSE;
 
 		from_offset = end_offset;
-		end_offset = offset + rec->header_size + rec->body_size;
+		end_offset = offset + hdr_size + body_size;
 
 		if (rec->msg_flags & MAIL_DELETED) {
 			if (!index_expunge_mail(ibox, rec, seq, notify))




More information about the dovecot-cvs mailing list