Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8886:11d2f0fffb61 HEAD
istream-tee: Added some more asserts.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 01 Apr 2009 16:09:58 -0400 |
parents | 5e513d6612e0 |
children | 7ddf32656d8c |
files | src/lib/istream-tee.c |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/istream-tee.c Wed Apr 01 15:58:56 2009 -0400 +++ b/src/lib/istream-tee.c Wed Apr 01 16:09:58 2009 -0400 @@ -123,9 +123,9 @@ the parent stream without having to read more. */ last_high_offset = stream->istream.v_offset + (stream->pos - stream->skip); - i_assert(last_high_offset <= input->v_offset + size); - if (last_high_offset == input->v_offset + size) { + if (stream->pos == size) { /* we've read everything, need to read more */ + i_assert(last_high_offset == input->v_offset + size); tee_streams_skip(tstream->tee); ret = i_stream_read(input); if (ret <= 0) { @@ -143,6 +143,7 @@ data = i_stream_get_data(input, &size); } else { /* there's still some data available from parent */ + i_assert(last_high_offset < input->v_offset + size); i_assert(stream->pos < size); stream->buffer = data; }