Skip to content

Commit

Permalink
dcrypt: Allow stream prefetch
Browse files Browse the repository at this point in the history
We might get stream that has already been buffered, so we
must try read it in case buffer is full.
  • Loading branch information
cmouse authored and sirainen committed Sep 6, 2016
1 parent 2e7a019 commit 527d6c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib-dcrypt/istream-decrypt.c
Expand Up @@ -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)) {
Expand Down

0 comments on commit 527d6c5

Please sign in to comment.