summaryrefslogtreecommitdiff
path: root/inflate.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2016-09-20 18:49:21 -0700
committerMark Adler <madler@alumni.caltech.edu>2016-09-20 18:55:37 -0700
commit9852c209ac49c0d8d1192e46115d7c37d4344bbd (patch)
tree875f72cb5cbc1724f180cc866cef203ddbe3c075 /inflate.h
parent93b0af4aa73c8debe2cc18e56101700423096146 (diff)
downloadzlib-9852c209ac49c0d8d1192e46115d7c37d4344bbd.tar.gz
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.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/inflate.h b/inflate.h
index fbc9a67..adbc775 100644
--- a/inflate.h
+++ b/inflate.h
@@ -82,7 +82,8 @@ typedef enum {
struct inflate_state {
inflate_mode mode; /* current inflate mode */
int last; /* true if processing last block */
- int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
+ int wrap; /* bit 0 true for zlib, bit 1 true for gzip,
+ bit 2 true to validate check value */
int havedict; /* true if dictionary provided */
int flags; /* gzip header method and flags (0 if zlib) */
unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */