aboutsummaryrefslogtreecommitdiff
path: root/src/common/compress_zstd.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-02-18 16:19:43 -0500
committerNick Mathewson <nickm@torproject.org>2018-02-18 16:19:43 -0500
commit5199b9b33747ddcf787cf97d5e14b3b50a579802 (patch)
tree8ad43e8da0a27e8473f233595fbe876084d7e52e /src/common/compress_zstd.c
parente0427b6bf6bd9ea4c77a2225c0063ebb5938e280 (diff)
downloadtor-5199b9b33747ddcf787cf97d5e14b3b50a579802.tar.gz
tor-5199b9b33747ddcf787cf97d5e14b3b50a579802.zip
Use autoconf to check for optional zstd functionality.
Fixes a bug in our zstd-static code. Bug not in any released version of Tor.
Diffstat (limited to 'src/common/compress_zstd.c')
-rw-r--r--src/common/compress_zstd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/compress_zstd.c b/src/common/compress_zstd.c
index 4e26c724e8..4024f5594d 100644
--- a/src/common/compress_zstd.c
+++ b/src/common/compress_zstd.c
@@ -219,10 +219,14 @@ tor_zstd_state_size_precalc(int compress, int preset)
#ifdef ZSTD_STATIC_LINKING_ONLY
if (tor_zstd_can_use_static_apis()) {
if (compress) {
+#ifdef HAVE_ZSTD_ESTIMATECSTREAMSIZE
return ZSTD_estimateCStreamSize(preset);
+#endif
} else {
+#ifdef HAVE_ZSTD_ESTIMATEDCTXSIZE
/* Could use DStream, but that takes a windowSize. */
return ZSTD_estimateDCtxSize();
+#endif
}
}
#endif