]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dcrypt: Allow stream prefetch
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 25 Aug 2016 09:26:55 +0000 (12:26 +0300)
committerGitLab <gitlab@git.dovecot.net>
Fri, 2 Sep 2016 16:13:32 +0000 (19:13 +0300)
We might get stream that has already been buffered, so we
must try read it in case buffer is full.

src/lib-dcrypt/istream-decrypt.c

index c5807c2436d5a551717115d3da7fdc31fcc990d3..4f3ca12dfcb279a73849060ba1459b389a5237ed 100644 (file)
@@ -670,10 +670,12 @@ i_stream_decrypt_read(struct istream_private *stream)
                        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)) {