dovecot-2.2: lib-storage: Don't assume that we must read the who...

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 25 21:32:24 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/35c3194900b7
changeset: 17844:35c3194900b7
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Sep 26 00:32:03 2014 +0300
description:
lib-storage: Don't assume that we must read the whole message to get its virtual size.
This is true only with mbox format. All the other formats have various
metadata available where it's stored.

diffstat:

 src/lib-storage/index/index-mail.c |  15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)

diffs (25 lines):

diff -r abc434a32140 -r 35c3194900b7 src/lib-storage/index/index-mail.c
--- a/src/lib-storage/index/index-mail.c	Thu Sep 25 19:43:28 2014 +0300
+++ b/src/lib-storage/index/index-mail.c	Fri Sep 26 00:32:03 2014 +0300
@@ -1538,21 +1538,6 @@
 				(void)mail_get_hdr_stream(_mail, NULL, &input);
 		}
 	}
-
-	if ((data->wanted_fields & MAIL_FETCH_VIRTUAL_SIZE) != 0 &&
-	    data->virtual_size == (uoff_t)-1 &&
-	    _mail->lookup_abort == MAIL_LOOKUP_ABORT_NEVER &&
-	    ((data->access_part & (READ_HDR | PARSE_HDR)) == 0 ||
-	      (data->access_part & (READ_BODY | PARSE_BODY)) == 0)) {
-		/* we want virtual size, and we'd prefer not to read the entire
-		   message for it. see if it's possible. */
-		uoff_t vsize;
-
-		_mail->lookup_abort = MAIL_LOOKUP_ABORT_NOT_IN_CACHE;
-		if (mail_get_virtual_size(_mail, &vsize) < 0)
-			mail->data.access_part |= READ_HDR | READ_BODY;
-		_mail->lookup_abort = MAIL_LOOKUP_ABORT_NEVER;
-	}
 }
 
 void index_mail_set_seq(struct mail *_mail, uint32_t seq, bool saving)


More information about the dovecot-cvs mailing list