diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2010-04-08 01:41:22 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2010-04-08 01:41:22 +0400 |
commit | ba28a1d0d7ee56f935eb582d67607ed85da1eedb (patch) | |
tree | 3fe29861a2adc1415fe28546c68e5331b4505fe0 /support | |
parent | 273c99284a2b96c9772d3b66dae7a83ae04d8eb2 (diff) |
2010-04-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
* zlib-helper.c: now that we don't use Z_SYNC_FLUSH, there might be
unflushed input in zstream, so always call Z_FINISH.
svn path=/trunk/mono/; revision=154995
Diffstat (limited to 'support')
-rw-r--r-- | support/ChangeLog | 5 | ||||
-rw-r--r-- | support/zlib-helper.c | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index d7d1eccd6f0..3979c66ef2d 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,8 @@ +2010-04-07 Gonzalo Paniagua Javier <gonzalo@novell.com> + + * zlib-helper.c: now that we don't use Z_SYNC_FLUSH, there might be + unflushed input in zstream, so always call Z_FINISH. + 2010-04-02 Jonathan Pryor <jpryor@novell.com> * Makefile.am: On non-Windows platforms, MonoPosixHelper now links diff --git a/support/zlib-helper.c b/support/zlib-helper.c index f8f1587ccd9..23c662bf74d 100644 --- a/support/zlib-helper.c +++ b/support/zlib-helper.c @@ -103,14 +103,12 @@ CloseZStream (ZStream *zstream) status = 0; if (zstream->compress) { - if (zstream->stream->total_out) { - do { - status = deflate (zstream->stream, Z_FINISH); - flush_status = Flush (zstream); - } while (status == Z_OK); /* We want Z_STREAM_END or error here here */ - if (status == Z_STREAM_END) - status = flush_status; - } + do { + status = deflate (zstream->stream, Z_FINISH); + flush_status = Flush (zstream); + } while (status == Z_OK); /* We want Z_STREAM_END or error here here */ + if (status == Z_STREAM_END) + status = flush_status; deflateEnd (zstream->stream); } else { inflateEnd (zstream->stream); |