diff options
author | Alexander Færøy <ahf@torproject.org> | 2017-04-20 16:20:14 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-04-25 08:10:10 -0400 |
commit | 6b905b38bb850d0530ba6f6d02c10b1fb19aef9a (patch) | |
tree | 554986cb82ac4703d749a9422e475fe5e0ab5c34 /src/common/compress_zstd.c | |
parent | 1c77d8690caa1ad80b9d9581cac8eddae95e82d1 (diff) | |
download | tor-6b905b38bb850d0530ba6f6d02c10b1fb19aef9a.tar.gz tor-6b905b38bb850d0530ba6f6d02c10b1fb19aef9a.zip |
Add API entry-point for getting compression method version numbers.
This patch adds `tor_compress_version_str()` and
`tor_compress_header_version_str()` to get the version strings of the
different compression schema providers. Both functions returns `NULL` in
case a given `compress_method_t` is unknown or unsupported.
See: https://bugs.torproject.org/21662
Diffstat (limited to 'src/common/compress_zstd.c')
-rw-r--r-- | src/common/compress_zstd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/compress_zstd.c b/src/common/compress_zstd.c index dca4dbdab5..c838cd9364 100644 --- a/src/common/compress_zstd.c +++ b/src/common/compress_zstd.c @@ -38,7 +38,7 @@ tor_zstd_method_supported(void) } /** Return a string representation of the version of the currently running - * version of libzstd. */ + * version of libzstd. Returns NULL if Zstandard is unsupported. */ const char * tor_zstd_get_version_str(void) { @@ -55,19 +55,19 @@ tor_zstd_get_version_str(void) return version_str; #else - return "N/A"; + return NULL; #endif } /** Return a string representation of the version of the version of libzstd - * used at compilation. */ + * used at compilation time. Returns NULL if Zstandard is unsupported. */ const char * tor_zstd_get_header_version_str(void) { #ifdef HAVE_ZSTD return ZSTD_VERSION_STRING; #else - return "N/A"; + return NULL; #endif } |