dovecot-1.1: i_stream_read_data(): Error handling fixes.

dovecot at dovecot.org dovecot at dovecot.org
Sat Sep 13 12:22:15 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/983f82053800
changeset: 7881:983f82053800
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Sep 13 12:22:11 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 12670c6d0c10 -r 983f82053800 src/lib/istream.c
--- a/src/lib/istream.c	Sat Sep 13 11:55:59 2008 +0300
+++ b/src/lib/istream.c	Sat Sep 13 12:22:11 2008 +0300
@@ -289,10 +289,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