diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-04-25 09:54:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-04-25 10:50:50 -0400 |
commit | 4b01b45ec1a2d561eab8bf7d8934857268e48701 (patch) | |
tree | b8e193247fe1e7decf263bee8ad68e6f0a6133c2 /src/common/compress_zlib.c | |
parent | 880fb3e3a9aba21c0b36aa4aa5659432e90eb827 (diff) | |
download | tor-4b01b45ec1a2d561eab8bf7d8934857268e48701.tar.gz tor-4b01b45ec1a2d561eab8bf7d8934857268e48701.zip |
Add a "best compression" flag.
Diffstat (limited to 'src/common/compress_zlib.c')
-rw-r--r-- | src/common/compress_zlib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/compress_zlib.c b/src/common/compress_zlib.c index 37768ee49e..d8200d5d3d 100644 --- a/src/common/compress_zlib.c +++ b/src/common/compress_zlib.c @@ -56,6 +56,7 @@ memory_level(compression_level_t level) { switch (level) { default: + case BEST_COMPRESSION: return 9; case HIGH_COMPRESSION: return 8; case MEDIUM_COMPRESSION: return 7; case LOW_COMPRESSION: return 6; @@ -70,6 +71,7 @@ method_bits(compress_method_t method, compression_level_t level) const int flag = method == GZIP_METHOD ? 16 : 0; switch (level) { default: + case BEST_COMPRESSION: case HIGH_COMPRESSION: return flag + 15; case MEDIUM_COMPRESSION: return flag + 13; case LOW_COMPRESSION: return flag + 11; @@ -162,7 +164,7 @@ tor_zlib_compress_new(int compress_, if (! compress_) { /* use this setting for decompression, since we might have the * max number of window bits */ - compression_level = HIGH_COMPRESSION; + compression_level = BEST_COMPRESSION; } out = tor_malloc_zero(sizeof(tor_zlib_compress_state_t)); |