diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2016-09-20 18:49:21 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2016-09-20 18:55:37 -0700 |
commit | 9852c209ac49c0d8d1192e46115d7c37d4344bbd (patch) | |
tree | 875f72cb5cbc1724f180cc866cef203ddbe3c075 /inflate.h | |
parent | 93b0af4aa73c8debe2cc18e56101700423096146 (diff) | |
download | zlib-9852c209ac49c0d8d1192e46115d7c37d4344bbd.tar.gz zlib-9852c209ac49c0d8d1192e46115d7c37d4344bbd.tar.bz2 zlib-9852c209ac49c0d8d1192e46115d7c37d4344bbd.zip |
Add option to not compute or check check values.
The undocumented (except in these commit comments) function
inflateValidate(strm, check) can be called after an inflateInit(),
inflateInit2(), or inflateReset2() with check equal to zero to
turn off the check value (CRC-32 or Adler-32) computation and
comparison. Calling with check not equal to zero turns checking
back on. This should only be called immediately after the init or
reset function. inflateReset() does not change the state, so a
previous inflateValidate() setting will remain in effect.
This also turns off validation of the gzip header CRC when
present.
This should only be used when a zlib or gzip stream has already
been checked, and repeated decompressions of the same stream no
longer need to be validated.
Diffstat (limited to 'inflate.h')
-rw-r--r-- | inflate.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -82,7 +82,8 @@ typedef enum { | |||
82 | struct inflate_state { | 82 | struct inflate_state { |
83 | inflate_mode mode; /* current inflate mode */ | 83 | inflate_mode mode; /* current inflate mode */ |
84 | int last; /* true if processing last block */ | 84 | int last; /* true if processing last block */ |
85 | int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ | 85 | int wrap; /* bit 0 true for zlib, bit 1 true for gzip, |
86 | bit 2 true to validate check value */ | ||
86 | int havedict; /* true if dictionary provided */ | 87 | int havedict; /* true if dictionary provided */ |
87 | int flags; /* gzip header method and flags (0 if zlib) */ | 88 | int flags; /* gzip header method and flags (0 if zlib) */ |
88 | unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ | 89 | unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ |