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

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


details:   http://hg.dovecot.org/dovecot-1.1/rev/632777217f7b
changeset: 8183:632777217f7b
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 04 18:03:03 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 f9afa9906e54 -r 632777217f7b 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:03 2009 -0500
@@ -181,9 +181,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 */
@@ -360,6 +364,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