X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/be59d0ec2329bd6949bd2fd87ebd9ff69770cfb9..57f74bd1c2da4cb1a5fb7a83f0ae978d210d3c2d:/zlib/deflate.c diff --git a/zlib/deflate.c b/zlib/deflate.c index 74f67cfe..07814c7a 100644 --- a/zlib/deflate.c +++ b/zlib/deflate.c @@ -1110,6 +1110,11 @@ local block_state deflate_stored(s, flush) s->strstart += s->lookahead; s->lookahead = 0; + if (flush == Z_INSERT_ONLY) { + s->block_start = s->strstart; + continue; + } + /* Emit a stored block if pending_buf will be full: */ max_start = s->block_start + max_block_size; if (s->strstart == 0 || (ulg)s->strstart >= max_start) { @@ -1125,6 +1130,11 @@ local block_state deflate_stored(s, flush) FLUSH_BLOCK(s, 0); } } + if (flush == Z_INSERT_ONLY) { + s->block_start = s->strstart; + return need_more; + } + FLUSH_BLOCK(s, flush == Z_FINISH); return flush == Z_FINISH ? finish_done : block_done; }