summaryrefslogtreecommitdiff
path: root/lib/Handle.cc
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-08-16 22:48:17 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-08-16 22:48:17 +0200
commited5a1e2a7b8211b6cbc6e6801e1f018a13520598 (patch)
tree1a516acb3bae80e31e7a8e7408eada06c6b2123a /lib/Handle.cc
parentb011a334614861a603f7837c536c51c69b0a4258 (diff)
Adding raw inflate support, also should hopefully support gz files using zlib_inflate.
Diffstat (limited to 'lib/Handle.cc')
-rw-r--r--lib/Handle.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 39bc981..4ee233c 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -869,7 +869,7 @@ int Handle::GetNbHandles() {
//
// shamelessly ripped from http://www.zlib.net/zpipe.c
//
-int Handle::zlib_inflate(Handle * in, Handle * out) throw (GeneralException) {
+int Handle::zlib_inflate(Handle * in, Handle * out, bool raw) throw (GeneralException) {
int ret;
z_stream s;
unsigned char b_in[CHUNK];
@@ -886,7 +886,7 @@ int Handle::zlib_inflate(Handle * in, Handle * out) throw (GeneralException) {
have = total_out = 0;
- ret = inflateInit(&s);
+ ret = inflateInit2(&s, raw ? -15 : 0);
if (ret != Z_OK) {
throw GeneralException("zlib: inflateInit() failed: " + String(ret));
}