dovecot-1.2: mbox: Possible assert-crashfix. Also added some com...

dovecot at dovecot.org dovecot at dovecot.org
Thu Mar 5 01:03:28 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/60e778555558
changeset: 8801:60e778555558
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 04 18:03:23 2009 -0500
description:
mbox: Possible assert-crashfix. Also added some comments.

diffstat:

1 file changed, 5 insertions(+)
src/lib-storage/index/mbox/istream-raw-mbox.c |    5 +++++

diffs (25 lines):

diff -r ce28325cc1c4 -r 60e778555558 src/lib-storage/index/mbox/istream-raw-mbox.c
--- a/src/lib-storage/index/mbox/istream-raw-mbox.c	Mon Mar 02 22:16:15 2009 -0500
+++ b/src/lib-storage/index/mbox/istream-raw-mbox.c	Wed Mar 04 18:03:23 2009 -0500
@@ -183,9 +183,13 @@ static ssize_t i_stream_raw_mbox_read(st
 		if (ret == -2) {
 			if (stream->istream.v_offset + pos ==
 			    rstream->input_peak_offset) {
+				/* we've read everything our parent stream
+				   has to offer. */
 				stream->buffer = buf;
 				return -2;
 			}
+			/* parent stream is full, but we haven't returned
+			   all its bytes to our caller yet. */
 		} else if (stream->istream.v_offset != 0 || pos == 0) {
 			/* we've read the whole file, final byte should be
 			   the \n trailer */
@@ -364,6 +368,7 @@ static void i_stream_raw_mbox_sync(struc
 
 	rstream->istream.skip = 0;
 	rstream->istream.pos = 0;
+	rstream->input_peak_offset = 0;
 }
 
 static const struct stat *


More information about the dovecot-cvs mailing list