Align deflateParams() and its documentation in zlib.h.

This updates the documentation to reflect the behavior of
deflateParams() when it is not able to compress all of the input
data provided so far due to insufficient output space.  It also
assures that data provided is compressed before the parameter
changes, even if at the beginning of the stream.
This commit is contained in:
Mark Adler
2015-08-02 00:02:07 -07:00
parent b4ce6caf09
commit 43bfaba3d7
2 changed files with 25 additions and 12 deletions

View File

@@ -509,8 +509,7 @@ int ZEXPORT deflateParams(strm, level, strategy)
}
func = configuration_table[s->level].func;
if ((strategy != s->strategy || func != configuration_table[level].func) &&
strm->total_in != 0) {
if ((strategy != s->strategy || func != configuration_table[level].func)) {
/* Flush the last buffer: */
err = deflate(strm, Z_BLOCK);
if (err == Z_BUF_ERROR && s->pending == 0)