diff options
author | Wayne Davison <wayned@samba.org> | 2005-01-02 09:03:44 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2005-01-02 09:03:44 +0000 |
commit | 0301b334c7a588a2f192b7eeb796156e8f5f8f0b (patch) | |
tree | cb52814bde05845cf8ee1724fe183a8bee7ea5aa /zlib | |
parent | 1492b4b2b20d6dddc5eb22909a6853b0e96a50c5 (diff) | |
download | rsync-0301b334c7a588a2f192b7eeb796156e8f5f8f0b.tar.gz rsync-0301b334c7a588a2f192b7eeb796156e8f5f8f0b.tar.bz2 rsync-0301b334c7a588a2f192b7eeb796156e8f5f8f0b.zip |
Fixed Z_INSERT_ONLY support in deflate_stored().
Diffstat (limited to 'zlib')
-rw-r--r-- | zlib/deflate.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/zlib/deflate.c b/zlib/deflate.c index 20209df4..07814c7a 100644 --- a/zlib/deflate.c +++ b/zlib/deflate.c @@ -1092,11 +1092,6 @@ local block_state deflate_stored(s, flush) max_block_size = s->pending_buf_size - 5; } - if (flush == Z_INSERT_ONLY) { - s->block_start = s->strstart; - return need_more; - } - /* Copy as much as possible from input to output: */ for (;;) { /* Fill the window as much as possible: */ @@ -1115,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) { @@ -1130,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; } |