diff options
author | Alexander Færøy <ahf@torproject.org> | 2017-04-20 15:56:38 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-04-25 08:10:09 -0400 |
commit | 1c77d8690caa1ad80b9d9581cac8eddae95e82d1 (patch) | |
tree | 87cb3f07a2919f11fef5eafe671bd97f8c825710 /src/common/compress.h | |
parent | 04682d302aeeb0c2a0d9859bc0c1feee38daf16a (diff) | |
download | tor-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.h')
-rw-r--r-- | src/common/compress.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/compress.h b/src/common/compress.h index 1fd4325b7e..87306f5fb9 100644 --- a/src/common/compress.h +++ b/src/common/compress.h @@ -13,7 +13,8 @@ /** Enumeration of what kind of compression to use. Only ZLIB_METHOD and * GZIP_METHOD is guaranteed to be supported by the compress/uncompress - * functions here. */ + * functions here. Call tor_compress_supports_method() to check if a given + * compression schema is supported by Tor. */ typedef enum { NO_METHOD=0, GZIP_METHOD=1, @@ -51,6 +52,9 @@ tor_compress_memory_level(compression_level_t level); int tor_compress_is_compression_bomb(size_t size_in, size_t size_out); +int +tor_compress_supports_method(compress_method_t method); + size_t tor_compress_get_total_allocation(void); |