summaryrefslogtreecommitdiff
path: root/src/common/compress_zlib.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-04-20 15:56:38 +0200
committerNick Mathewson <nickm@torproject.org>2017-04-25 08:10:09 -0400
commit1c77d8690caa1ad80b9d9581cac8eddae95e82d1 (patch)
tree87cb3f07a2919f11fef5eafe671bd97f8c825710 /src/common/compress_zlib.c
parent04682d302aeeb0c2a0d9859bc0c1feee38daf16a (diff)
downloadtor-1c77d8690caa1ad80b9d9581cac8eddae95e82d1.tar.gz
tor-1c77d8690caa1ad80b9d9581cac8eddae95e82d1.zip
Add function to check if a given compression method is supported.
This patch adds support for checking if a given `compress_method_t` is supported by the currently running Tor instance using `tor_compress_supports_method()`. See: https://bugs.torproject.org/21662
Diffstat (limited to 'src/common/compress_zlib.c')
-rw-r--r--src/common/compress_zlib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/compress_zlib.c b/src/common/compress_zlib.c
index 2c9aba32ee..e1a68c2aa1 100644
--- a/src/common/compress_zlib.c
+++ b/src/common/compress_zlib.c
@@ -64,6 +64,16 @@ method_bits(compress_method_t method, compression_level_t level)
}
}
+/** Return 1 if zlib/gzip compression is supported; otherwise 0. */
+int
+tor_zlib_method_supported(void)
+{
+ /* We currently always support zlib/gzip, but we keep this function around in
+ * case we some day decide to deprecate zlib/gzip support.
+ */
+ return 1;
+}
+
/** Return a string representation of the version of the currently running
* version of zlib. */
const char *