Skip to content

Commit

Permalink
2010-04-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
Browse files Browse the repository at this point in the history
	* 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=/branches/mono-2-4/mono/; revision=154997
  • Loading branch information
gonzalop committed Apr 7, 2010
1 parent 438882b commit 2a736ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 5 additions & 0 deletions 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-01-28 Gonzalo Paniagua Javier <gonzalo@novell.com>

* zlib-helper.c: no need for sync flush when compressing.
Expand Down
14 changes: 6 additions & 8 deletions support/zlib-helper.c
Expand Up @@ -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);
Expand Down

0 comments on commit 2a736ca

Please sign in to comment.