< prev index next >
src/share/native/java/util/zip/zlib/deflate.c
Print this page
@@ -503,12 +503,10 @@
s = (deflate_state *)strm->state;
s->pending = 0;
s->pending_out = s->pending_buf;
- s->high_water = 0; /* reset to its inital value 0 */
-
if (s->wrap < 0) {
s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
}
s->status =
#ifdef GZIP
@@ -518,11 +516,11 @@
strm->adler =
#ifdef GZIP
s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
#endif
adler32(0L, Z_NULL, 0);
- s->last_flush = Z_NO_FLUSH;
+ s->last_flush = -2;
_tr_init(s);
return Z_OK;
}
@@ -611,11 +609,11 @@
return Z_STREAM_ERROR;
}
func = configuration_table[s->level].func;
if ((strategy != s->strategy || func != configuration_table[level].func) &&
- s->high_water) {
+ s->last_flush != -2) {
/* Flush the last buffer: */
int err = deflate(strm, Z_BLOCK);
if (err == Z_STREAM_ERROR)
return err;
if (strm->avail_out == 0)
< prev index next >