changeset 20694:fc3b43738811

dcrypt: Allow stream prefetch We might get stream that has already been buffered, so we must try read it in case buffer is full.
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Thu, 25 Aug 2016 12:26:55 +0300
parents fa67f1a329da
children 56d721e9ee64
files src/lib-dcrypt/istream-decrypt.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-dcrypt/istream-decrypt.c	Wed Aug 31 20:14:41 2016 +0300
+++ b/src/lib-dcrypt/istream-decrypt.c	Thu Aug 25 12:26:55 2016 +0300
@@ -670,10 +670,12 @@
 			stream->istream.eof = TRUE;
 			return -1;
 		}
+
 		/* need to read more input */
 		ret = i_stream_read(stream->parent);
-		if (ret == 0 || ret == -2)
+		if (ret == 0)
 			return ret;
+
 		data = i_stream_get_data(stream->parent, &size);
 
 		if (ret == -1 && (size == 0 || stream->parent->stream_errno != 0)) {