dovecot-1.2: istream: Added one more assert to make sure return ...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Apr 1 22:59:03 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/5e513d6612e0
changeset: 8885:5e513d6612e0
user: Timo Sirainen <tss at iki.fi>
date: Wed Apr 01 15:58:56 2009 -0400
description:
istream: Added one more assert to make sure return value is correct.
diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
src/lib/istream.c | 4 +++-
diffs (28 lines):
diff -r ec8e679294d0 -r 5e513d6612e0 src/lib/istream.c
--- a/src/lib/istream.c Wed Apr 01 15:39:20 2009 -0400
+++ b/src/lib/istream.c Wed Apr 01 15:58:56 2009 -0400
@@ -67,6 +67,7 @@ ssize_t i_stream_read(struct istream *st
ssize_t i_stream_read(struct istream *stream)
{
struct istream_private *_stream = stream->real_stream;
+ size_t old_size;
ssize_t ret;
if (unlikely(stream->closed))
@@ -75,6 +76,7 @@ ssize_t i_stream_read(struct istream *st
stream->eof = FALSE;
stream->stream_errno = 0;
+ old_size = _stream->pos - _stream->skip;
ret = _stream->read(_stream);
switch (ret) {
case -2:
@@ -94,7 +96,7 @@ ssize_t i_stream_read(struct istream *st
break;
default:
i_assert(ret > 0);
- i_assert((size_t)ret <= _stream->pos - _stream->skip);
+ i_assert((size_t)ret+old_size == _stream->pos - _stream->skip);
break;
}
return ret;
More information about the dovecot-cvs
mailing list