dovecot-1.2: i_stream_read_data(): Error handling fixes.
dovecot at dovecot.org
dovecot at dovecot.org
Sat Sep 13 12:22:34 EEST 2008
details: http://hg.dovecot.org/dovecot-1.2/rev/1ee313158639
changeset: 8194:1ee313158639
user: Timo Sirainen <tss at iki.fi>
date: Sat Sep 13 12:22:30 2008 +0300
description:
i_stream_read_data(): Error handling fixes.
diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
src/lib/istream.c | 10 ++++++++--
diffs (22 lines):
diff -r b3fb8215a339 -r 1ee313158639 src/lib/istream.c
--- a/src/lib/istream.c Sat Sep 13 11:56:16 2008 +0300
+++ b/src/lib/istream.c Sat Sep 13 12:22:30 2008 +0300
@@ -290,10 +290,16 @@ int i_stream_read_data(struct istream *s
if (ret == -2)
return -2;
- if (read_more || ret == 0) {
- i_assert(!stream->blocking || stream->eof);
+ if (ret == 0) {
+ /* need to read more */
+ i_assert(!stream->blocking);
return 0;
}
+ if (read_more && stream->eof) {
+ /* we read at least some new data */
+ return 0;
+ }
+ i_assert(stream->stream_errno != 0);
return -1;
}
More information about the dovecot-cvs
mailing list