summaryrefslogtreecommitdiff
path: root/lib/Handle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Handle.cc')
-rw-r--r--lib/Handle.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 457f2c9..e88663a 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -887,8 +887,8 @@ int Handle::zlib_inflate(Handle * in, Handle * out) throw (GeneralException) {
have = total_out = 0;
ret = inflateInit(&s);
- if (ret != Z_OK ) {
- throw GeneralException("zlib: deflateInit() failed: " + String(ret));
+ if (ret != Z_OK) {
+ throw GeneralException("zlib: inflateInit() failed: " + String(ret));
}
do {
@@ -927,7 +927,7 @@ int Handle::zlib_inflate(Handle * in, Handle * out) throw (GeneralException) {
return total_out;
}
-int Handle::zlib_deflate(Handle * in, Handle * out) throw (GeneralException) {
+int Handle::zlib_deflate(Handle * in, Handle * out, int level, bool raw) throw (GeneralException) {
int ret, flush;
z_stream s;
unsigned char b_in[CHUNK];
@@ -944,8 +944,8 @@ int Handle::zlib_deflate(Handle * in, Handle * out) throw (GeneralException) {
have = total_out = 0;
- ret = deflateInit(&s, Z_DEFAULT_COMPRESSION);
- if (ret != Z_OK ) {
+ ret = deflateInit2(&s, level, Z_DEFLATED, raw ? -15 : 15, 8, Z_DEFAULT_STRATEGY);
+ if (ret != Z_OK) {
throw GeneralException("zlib: deflateInit() failed: " + String(ret));
}