summaryrefslogtreecommitdiff
path: root/src/common/compress.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-04-24 14:20:16 +0200
committerNick Mathewson <nickm@torproject.org>2017-04-25 08:11:32 -0400
commitcf912259ba491e51f6f211e186ff67605ff269c8 (patch)
tree95878575ea7820970da112a3574708413bc11d6e /src/common/compress.c
parent69a41e8bc6e148c471ae8ee860e1a43548729db0 (diff)
downloadtor-cf912259ba491e51f6f211e186ff67605ff269c8.tar.gz
tor-cf912259ba491e51f6f211e186ff67605ff269c8.zip
Remove `tor_compress_memory_level()`.
This patch splits up `tor_compress_memory_level()` into static functions in the individual compression backends, which allows us to tune the values per compression backend rather than globally. See: https://bugs.torproject.org/21662
Diffstat (limited to 'src/common/compress.c')
-rw-r--r--src/common/compress.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/common/compress.c b/src/common/compress.c
index 8b49af8220..38b8184573 100644
--- a/src/common/compress.c
+++ b/src/common/compress.c
@@ -56,20 +56,6 @@ tor_compress_is_compression_bomb(size_t size_in, size_t size_out)
return (size_out / size_in > MAX_UNCOMPRESSION_FACTOR);
}
-/** Given <b>level</b> return the memory level. The memory level is needed for
- * the various compression backends used in Tor.
- */
-int
-tor_compress_memory_level(compression_level_t level)
-{
- switch (level) {
- default:
- case HIGH_COMPRESSION: return 8;
- case MEDIUM_COMPRESSION: return 7;
- case LOW_COMPRESSION: return 6;
- }
-}
-
/** Given <b>in_len</b> bytes at <b>in</b>, compress them into a newly
* allocated buffer, using the method described in <b>method</b>. Store the
* compressed string in *<b>out</b>, and its length in *<b>out_len</b>.