summaryrefslogtreecommitdiff
path: root/src/common/compress.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-04-27 11:30:51 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-27 11:30:51 -0400
commit2903c329aaad1b7628c1def4168270d626755566 (patch)
treebd2fd8ccc5b6e6cdef273819fc1b334bc84dc262 /src/common/compress.h
parent65ff0f8267b99a55a099eec2a71cb45557ae84eb (diff)
downloadtor-2903c329aaad1b7628c1def4168270d626755566.tar.gz
tor-2903c329aaad1b7628c1def4168270d626755566.zip
Move the "supported compression bitmask" into compress.[ch]
Diffstat (limited to 'src/common/compress.h')
-rw-r--r--src/common/compress.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/compress.h b/src/common/compress.h
index 95b70c02ec..5b47c5d458 100644
--- a/src/common/compress.h
+++ b/src/common/compress.h
@@ -16,12 +16,12 @@
* functions here. Call tor_compress_supports_method() to check if a given
* compression schema is supported by Tor. */
typedef enum {
- NO_METHOD=0,
+ NO_METHOD=0, // This method must be first.
GZIP_METHOD=1,
ZLIB_METHOD=2,
LZMA_METHOD=3,
ZSTD_METHOD=4,
- UNKNOWN_METHOD=5
+ UNKNOWN_METHOD=5, // This method must be last. Add new ones in the middle.
} compress_method_t;
/**
@@ -48,6 +48,7 @@ compress_method_t detect_compression_method(const char *in, size_t in_len);
int tor_compress_is_compression_bomb(size_t size_in, size_t size_out);
int tor_compress_supports_method(compress_method_t method);
+unsigned tor_compress_get_supported_method_bitmask(void);
const char * compression_method_get_name(compress_method_t method);
compress_method_t compression_method_get_by_name(const char *name);