From: Timo Sirainen Date: Wed, 4 Mar 2009 23:03:23 +0000 (-0500) Subject: mbox: Possible assert-crashfix. Also added some comments. X-Git-Tag: 1.2.beta2~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=396238573072714ef5c09846192703302ff6d367;p=thirdparty%2Fdovecot%2Fcore.git mbox: Possible assert-crashfix. Also added some comments. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/istream-raw-mbox.c b/src/lib-storage/index/mbox/istream-raw-mbox.c index d3457bc405..cc6538f713 100644 --- a/src/lib-storage/index/mbox/istream-raw-mbox.c +++ b/src/lib-storage/index/mbox/istream-raw-mbox.c @@ -183,9 +183,13 @@ static ssize_t i_stream_raw_mbox_read(struct istream_private *stream) 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(struct istream_private *stream) rstream->istream.skip = 0; rstream->istream.pos = 0; + rstream->input_peak_offset = 0; } static const struct stat *