i_assert(zs->avail_in == 0);
- if (zstream->flushed)
+ if (zstream->flushed) {
+ i_assert(zstream->outbuf_used == 0);
return 1;
+ }
if ((ret = o_stream_flush_parent_if_needed(&zstream->ostream)) <= 0)
return ret;
if (final)
zstream->flushed = TRUE;
- return zstream->outbuf_used == 0 ? 1 : 0;
+ i_assert(zstream->outbuf_used == 0);
+ return 1;
}
static int o_stream_bzlib_flush(struct ostream_private *stream)
i_assert(zs->avail_in == 0);
- if (zstream->flushed)
+ if (zstream->flushed) {
+ i_assert(zstream->outbuf_used == 0);
return 1;
+ }
if ((ret = o_stream_flush_parent_if_needed(&zstream->ostream)) <= 0)
return ret;
if (final)
zstream->flushed = TRUE;
- return zstream->outbuf_used == 0 ? 1 : 0;
+ i_assert(zstream->outbuf_used == 0);
+ return 1;
}
static int o_stream_lzma_flush(struct ostream_private *stream)
i_assert(zs->avail_in == 0);
- if (zstream->flushed)
+ if (zstream->flushed) {
+ i_assert(zstream->outbuf_used == 0);
return 1;
+ }
if ((ret = o_stream_flush_parent_if_needed(&zstream->ostream)) <= 0)
return ret;
}
if (final)
zstream->flushed = TRUE;
- return zstream->outbuf_used == 0 ? 1 : 0;
+ i_assert(zstream->outbuf_used == 0);
+ return 1;
}
static int o_stream_zlib_flush(struct ostream_private *stream)
{
int ret;
- if (zstream->flushed)
+ if (zstream->flushed) {
+ i_assert(zstream->output.pos == 0);
return 1;
+ }
if ((ret = o_stream_flush_parent_if_needed(&zstream->ostream)) <= 0)
return ret;
if (final)
zstream->flushed = TRUE;
+ i_assert(zstream->output.pos == 0);
return 1;
}