summaryrefslogtreecommitdiff
path: root/lib/Handle.cc
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-07-01 19:49:24 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-07-01 19:49:24 +0200
commitecf0de245cba43276df7ac4a9410361e0346a2a0 (patch)
tree4bd20b9310ee026e0af1894bf3d85232f181dfeb /lib/Handle.cc
parent556aa54bfdfdc72c49a9ea705fe81c03f596c732 (diff)
Adding gzip generation from zlib_deflate.
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 e88663a..39bc981 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -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, int level, bool raw) throw (GeneralException) {
+int Handle::zlib_deflate(Handle * in, Handle * out, int level, bool raw, bool gzip) throw (GeneralException) {
int ret, flush;
z_stream s;
unsigned char b_in[CHUNK];
@@ -944,7 +944,7 @@ int Handle::zlib_deflate(Handle * in, Handle * out, int level, bool raw) throw (
have = total_out = 0;
- ret = deflateInit2(&s, level, Z_DEFLATED, raw ? -15 : 15, 8, Z_DEFAULT_STRATEGY);
+ ret = deflateInit2(&s, level, Z_DEFLATED, gzip ? 31 : (raw ? -15 : 15), 8, Z_DEFAULT_STRATEGY);
if (ret != Z_OK) {
throw GeneralException("zlib: deflateInit() failed: " + String(ret));
}