From: Aki Tuomi Date: Thu, 25 Aug 2016 09:26:55 +0000 (+0300) Subject: dcrypt: Allow stream prefetch X-Git-Tag: 2.3.0.rc1~3085 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4b4e8dcad11120fa006e8edf1c659271ed5bd800;p=thirdparty%2Fdovecot%2Fcore.git dcrypt: Allow stream prefetch We might get stream that has already been buffered, so we must try read it in case buffer is full. --- diff --git a/src/lib-dcrypt/istream-decrypt.c b/src/lib-dcrypt/istream-decrypt.c index c5807c2436..4f3ca12dfc 100644 --- a/src/lib-dcrypt/istream-decrypt.c +++ b/src/lib-dcrypt/istream-decrypt.c @@ -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)) {