diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-09-05 20:18:07 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-09-06 16:15:39 +0200 |
commit | 79cc502e5d065a9a700f46d004873b0a6fac1130 (patch) | |
tree | af57864f6175fe4dbd700c7da226ce54f6f6035b /source4/librpc | |
parent | 56b6b4a68f51be8845afd024a45843331c0810ed (diff) | |
download | samba-79cc502e5d065a9a700f46d004873b0a6fac1130.tar.gz samba-79cc502e5d065a9a700f46d004873b0a6fac1130.tar.bz2 samba-79cc502e5d065a9a700f46d004873b0a6fac1130.zip |
ndr_compression: use inflateReset() and inflateSetDictionary() instead of inflateReset2()
Now we can use an unmodified system zlib-1.2.3
metze
(This used to be commit d68e36b485239cbaf99a6dce3f3bf52b4abcd06d)
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/ndr/ndr_compression.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source4/librpc/ndr/ndr_compression.c b/source4/librpc/ndr/ndr_compression.c index 37f95bb1b6..0b33d40c24 100644 --- a/source4/librpc/ndr/ndr_compression.c +++ b/source4/librpc/ndr/ndr_compression.c @@ -104,13 +104,6 @@ static enum ndr_err_code ndr_pull_compression_mszip_chunk(struct ndr_pull *ndrpu zError(z_ret), z_ret); } - } else { - z_ret = inflateReset2(z, Z_RESET_KEEP_WINDOW); - if (z_ret != Z_OK) { - return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, - "Bad inflateReset2 error %s(%d) (PULL)", - zError(z_ret), z_ret); - } } /* call inflate untill we get Z_STREAM_END or an error */ @@ -142,6 +135,20 @@ static enum ndr_err_code ndr_pull_compression_mszip_chunk(struct ndr_pull *ndrpu *last = true; } + z_ret = inflateReset(z); + if (z_ret != Z_OK) { + return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, + "Bad inflateReset error %s(%d) (PULL)", + zError(z_ret), z_ret); + } + + z_ret = inflateSetDictionary(z, plain_chunk.data, plain_chunk.length); + if (z_ret != Z_OK) { + return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, + "Bad inflateSetDictionary error %s(%d) (PULL)", + zError(z_ret), z_ret); + } + return NDR_ERR_SUCCESS; } |