dovecot-2.0: dbox: Fixed looking up physical size when it wasn't...

dovecot at dovecot.org dovecot at dovecot.org
Fri Feb 19 14:11:26 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/97a4289d6d4b
changeset: 10769:97a4289d6d4b
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Feb 19 14:11:21 2010 +0200
description:
dbox: Fixed looking up physical size when it wasn't in metadata.

diffstat:

 src/lib-storage/index/dbox-common/dbox-mail.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r f11ffb8a65f8 -r 97a4289d6d4b src/lib-storage/index/dbox-common/dbox-mail.c
--- a/src/lib-storage/index/dbox-common/dbox-mail.c	Fri Feb 19 12:19:27 2010 +0200
+++ b/src/lib-storage/index/dbox-common/dbox-mail.c	Fri Feb 19 14:11:21 2010 +0200
@@ -75,23 +75,22 @@
 {
 	struct dbox_mail *mail = (struct dbox_mail *)_mail;
 	struct index_mail_data *data = &mail->imail.data;
-	struct istream *input;
+	struct dbox_file *file;
 	const char *value;
 
 	if (index_mail_get_physical_size(_mail, size_r) == 0)
 		return 0;
 
 	/* see if we have it in metadata */
-	if (dbox_mail_metadata_get(mail, DBOX_METADATA_PHYSICAL_SIZE,
-				   &value) < 0)
+	if (dbox_mail_metadata_read(mail, &file) < 0)
 		return -1;
 
+	value = dbox_file_metadata_get(file, DBOX_METADATA_PHYSICAL_SIZE);
 	if (value != NULL)
 		data->physical_size = strtoul(value, NULL, 16);
 	else {
-		if (mail_get_stream(_mail, NULL, NULL, &input) < 0)
-			return -1;
-		i_assert(data->physical_size != (uoff_t)-1);
+		/* no. that means we can use the size in the header */
+		data->physical_size = file->cur_physical_size;
 	}
 	*size_r = data->physical_size;
 	return 0;


More information about the dovecot-cvs mailing list