X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/06b91d8eb97dd7ba1fa8af3f58e5aee28d831b3f..7f2a1f651e6db7483bcb3d2678dcb60cc4e54582:/zlib/deflate.c diff --git a/zlib/deflate.c b/zlib/deflate.c index 39a968d5..07814c7a 100644 --- a/zlib/deflate.c +++ b/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly "; + " deflate 1.1.4 Copyright 1995-2002 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -242,7 +242,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, windowBits = -windowBits; } if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) { return Z_STREAM_ERROR; } @@ -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; }