dovecot-2.2: istream-seekable: Underlying stream errors weren't ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 6 17:40:52 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/47085487f3d8
changeset: 15385:47085487f3d8
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 06 17:40:34 2012 +0200
description:
istream-seekable: Underlying stream errors weren't handled correctly.

diffstat:

 src/lib/istream-seekable.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (24 lines):

diff -r cca85adcb583 -r 47085487f3d8 src/lib/istream-seekable.c
--- a/src/lib/istream-seekable.c	Tue Nov 06 14:20:00 2012 +0200
+++ b/src/lib/istream-seekable.c	Tue Nov 06 17:40:34 2012 +0200
@@ -139,9 +139,8 @@
 		return -1;
 	}
 
-	while ((ret = i_stream_read(sstream->cur_input)) < 0) {
-		if (!sstream->cur_input->eof) {
-			/* full / error */
+	while ((ret = i_stream_read(sstream->cur_input)) == -1) {
+		if (sstream->cur_input->stream_errno != 0) {
 			sstream->istream.istream.stream_errno =
 				sstream->cur_input->stream_errno;
 			return -1;
@@ -183,7 +182,7 @@
 		if (size == 0) {
 			/* read more to buffer */
 			*ret_r = read_more(sstream);
-			if (*ret_r <= 0)
+			if (*ret_r == 0 || *ret_r == -1)
 				return TRUE;
 		}
 


More information about the dovecot-cvs mailing list