Changeset: b4607d01324c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b4607d01324c
Modified Files:
        common/stream/gz_stream.c
Branch: Oct2020
Log Message:

Always apply default gz compression level if none specified

In some cases, deflateInit2 would get called with level==0
which means no compression.


diffs (27 lines):

diff --git a/common/stream/gz_stream.c b/common/stream/gz_stream.c
--- a/common/stream/gz_stream.c
+++ b/common/stream/gz_stream.c
@@ -141,6 +141,8 @@ gz_stream(stream *inner, int level)
                gz->indeflateEnd = deflateEnd;
                gz->strm.next_out = gz->buf;
                gz->strm.avail_out = sizeof(gz->buf);
+               if (level == 0)
+                       level = 6;
                ret = deflateInit2(&gz->strm, level, Z_DEFLATED, 15 | 16, 8, 
Z_DEFAULT_STRATEGY);
        }
 
@@ -167,13 +169,12 @@ static stream *
 open_gzstream(const char *restrict filename, const char *restrict flags)
 {
        stream *inner;
-       int preset = 6;
 
        inner = open_stream(filename, flags);
        if (inner == NULL)
                return NULL;
 
-       return gz_stream(inner, preset);
+       return gz_stream(inner, 0);
 }
 
 stream *
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to