]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-compression: Changed impossible errors to asserts.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 16 May 2016 13:55:34 +0000 (16:55 +0300)
committerGitLab <gitlab@git.dovecot.net>
Wed, 18 May 2016 12:21:30 +0000 (15:21 +0300)
o_stream_flush() no longer calls the stream's flush() if stream has failed.

src/lib-compression/ostream-bzlib.c
src/lib-compression/ostream-lzma.c
src/lib-compression/ostream-zlib.c

index 4e9cf2ec67c6b9baaaca3e564c09ac4f7eec5ec3..ed6e797f890a9eefbf06983639dd7372cf023842 100644 (file)
@@ -103,12 +103,7 @@ static int o_stream_bzlib_send_flush(struct bzlib_ostream *zstream)
        bool done = FALSE;
        int ret;
 
-       if (zs->avail_in != 0) {
-               i_assert(zstream->ostream.ostream.last_failed_errno != 0);
-               zstream->ostream.ostream.stream_errno =
-                       zstream->ostream.ostream.last_failed_errno;
-               return -1;
-       }
+       i_assert(zs->avail_in == 0);
 
        if (zstream->flushed)
                return 0;
index 4fcd04e8be2212f32fe786a01a6c15a5252a3596..5000d5da69a10ff40468e76c2b409cc17591b3fa 100644 (file)
@@ -109,12 +109,7 @@ static int o_stream_lzma_send_flush(struct lzma_ostream *zstream)
        bool done = FALSE;
        int ret;
 
-       if (zs->avail_in != 0) {
-               i_assert(zstream->ostream.ostream.last_failed_errno != 0);
-               zstream->ostream.ostream.stream_errno =
-                       zstream->ostream.ostream.last_failed_errno;
-               return -1;
-       }
+       i_assert(zs->avail_in == 0);
 
        if (zstream->flushed)
                return 0;
index 134cbff7cc4bcf831a92f51f92a376411d37ebf2..d043e4bdbfff1fff4bdf689dcb0704dcef9c5f04 100644 (file)
@@ -172,12 +172,7 @@ o_stream_zlib_send_flush(struct zlib_ostream *zstream, bool final)
        bool done = FALSE;
        int ret, flush;
 
-       if (zs->avail_in != 0) {
-               i_assert(zstream->ostream.ostream.last_failed_errno != 0);
-               zstream->ostream.ostream.stream_errno =
-                       zstream->ostream.ostream.last_failed_errno;
-               return -1;
-       }
+       i_assert(zs->avail_in == 0);
 
        if (zstream->flushed)
                return 0;