dovecot-1.1: When reading dbox metadata, flush the input stream'...

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 11 09:10:15 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/8afcffeae291
changeset: 7406:8afcffeae291
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 11 09:07:08 2008 +0200
description:
When reading dbox metadata, flush the input stream's cached data first to
make sure the latest metadata is used.

diffstat:

1 file changed, 4 insertions(+), 1 deletion(-)
src/lib-storage/index/dbox/dbox-file.c |    5 ++++-

diffs (22 lines):

diff -r 0d3ab8eaeedf -r 8afcffeae291 src/lib-storage/index/dbox/dbox-file.c
--- a/src/lib-storage/index/dbox/dbox-file.c	Tue Mar 11 08:14:21 2008 +0200
+++ b/src/lib-storage/index/dbox/dbox-file.c	Tue Mar 11 09:07:08 2008 +0200
@@ -851,7 +851,7 @@ int dbox_file_metadata_seek(struct dbox_
 		p_clear(file->metadata_pool);
 	} else {
 		file->metadata_pool =
-			pool_alloconly_create("dbox metadata", 512);
+			pool_alloconly_create("dbox metadata", 1024);
 	}
 	file->metadata_read_offset = 0;
 	p_array_init(&file->metadata, file->metadata_pool, 16);
@@ -867,6 +867,9 @@ int dbox_file_metadata_seek(struct dbox_
 			*expunged_r = TRUE;
 			return 1;
 		}
+	} else {
+		/* make sure to flush any cached data */
+		i_stream_sync(file->input);
 	}
 
 	i_stream_seek(file->input, metadata_offset);


More information about the dovecot-cvs mailing list