# HG changeset patch # User Timo Sirainen # Date 1236207783 18000 # Node ID 632777217f7b1d66a299017652b2659dd5c2d281 # Parent f9afa9906e54697f03a1cfd066e45b12aab2f01a mbox: Possible assert-crashfix. Also added some comments. 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 @@ 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 @@ rstream->istream.skip = 0; rstream->istream.pos = 0; + rstream->input_peak_offset = 0; } static const struct stat *