]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istream - Simplify i_stream_read_data() EOF and error handling
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 26 Sep 2023 00:06:23 +0000 (02:06 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Sat, 18 Nov 2023 18:58:04 +0000 (18:58 +0000)
src/lib/istream.c

index 073662fdd60c7613159855e1a12c9e55d3a5b7d4..168456f01f65b4488d8a3bd4f62b612c465b55ef 100644 (file)
@@ -797,13 +797,9 @@ int i_stream_read_data(struct istream *stream, const unsigned char **data_r,
                i_assert(!stream->blocking);
                return 0;
        }
-       if (stream->eof) {
-               if (read_more) {
-                       /* we read at least some new data */
-                       return 0;
-               }
-       } else {
-               i_assert(stream->stream_errno != 0);
+       if (stream->stream_errno == 0 && read_more) {
+               /* we read at least some new data */
+               return 0;
        }
        return -1;
 }