aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-05-01 15:31:28 -0400
committerNick Mathewson <nickm@torproject.org>2017-05-01 15:31:28 -0400
commitc486ef57a320b840fb50b184ee4ee806d9715888 (patch)
treea13becf66e7c503e72a83dfcd0fcebf09ce01acb
parent4837421d7cb6bcc52d5ffd09527ac786759b3b0a (diff)
downloadtor-c486ef57a320b840fb50b184ee4ee806d9715888.tar.gz
tor-c486ef57a320b840fb50b184ee4ee806d9715888.zip
Rename x-lzma to x-tor-lzma
We shouldn't call it lzma, because we are imposing a limit on the memory needed for decoding.
-rw-r--r--src/common/compress.c4
-rw-r--r--src/test/test_buffers.c2
-rw-r--r--src/test/test_dir_handle_get.c7
-rw-r--r--src/test/test_util.c2
4 files changed, 9 insertions, 6 deletions
diff --git a/src/common/compress.c b/src/common/compress.c
index 738df9f185..047f904cc7 100644
--- a/src/common/compress.c
+++ b/src/common/compress.c
@@ -313,7 +313,9 @@ static const struct {
} compression_method_names[] = {
{ "gzip", GZIP_METHOD },
{ "deflate", ZLIB_METHOD },
- { "x-lzma", LZMA_METHOD },
+ // We call this "x-tor-lzma" rather than "x-lzma", because we impose a
+ // lower maximum memory usage on the decoding side.
+ { "x-tor-lzma", LZMA_METHOD },
{ "x-zstd" , ZSTD_METHOD },
{ "identity", NO_METHOD },
diff --git a/src/test/test_buffers.c b/src/test/test_buffers.c
index ce5ac97b3d..c0e222bbb1 100644
--- a/src/test/test_buffers.c
+++ b/src/test/test_buffers.c
@@ -854,7 +854,7 @@ struct testcase_t buffer_tests[] = {
{ "compress/zstd", test_buffers_compress, TT_FORK,
&passthrough_setup, (char*)"x-zstd" },
{ "compress/lzma", test_buffers_compress, TT_FORK,
- &passthrough_setup, (char*)"x-lzma" },
+ &passthrough_setup, (char*)"x-tor-lzma" },
END_OF_TESTCASES
};
diff --git a/src/test/test_dir_handle_get.c b/src/test/test_dir_handle_get.c
index 7794bd7d65..6e963913d1 100644
--- a/src/test/test_dir_handle_get.c
+++ b/src/test/test_dir_handle_get.c
@@ -2530,13 +2530,14 @@ test_dir_handle_get_parse_accept_encoding(void *arg)
encodings = parse_accept_encoding_header("gzip");
tt_uint_op(B_NONE|B_GZIP, OP_EQ, encodings);
- encodings = parse_accept_encoding_header("x-zstd, deflate, x-lzma");
+ encodings = parse_accept_encoding_header("x-zstd, deflate, x-tor-lzma");
tt_uint_op(B_NONE|B_ZLIB|B_ZSTD|B_LZMA, OP_EQ, encodings);
- encodings = parse_accept_encoding_header("x-zstd, deflate, x-lzma, gzip");
+ encodings = parse_accept_encoding_header(
+ "x-zstd, deflate, x-tor-lzma, gzip");
tt_uint_op(B_NONE|B_ZLIB|B_ZSTD|B_LZMA|B_GZIP, OP_EQ, encodings);
- encodings = parse_accept_encoding_header("x-zstd,deflate,x-lzma,gzip");
+ encodings = parse_accept_encoding_header("x-zstd,deflate,x-tor-lzma,gzip");
tt_uint_op(B_NONE|B_ZLIB|B_ZSTD|B_LZMA|B_GZIP, OP_EQ, encodings);
done:
diff --git a/src/test/test_util.c b/src/test/test_util.c
index dec1d526c8..022f29c0fd 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -5753,7 +5753,7 @@ struct testcase_t util_tests[] = {
UTIL_LEGACY(pow2),
COMPRESS(zlib, "deflate"),
COMPRESS(gzip, "gzip"),
- COMPRESS(lzma, "x-lzma"),
+ COMPRESS(lzma, "x-tor-lzma"),
COMPRESS(zstd, "x-zstd"),
UTIL_TEST(gzip_compression_bomb, TT_FORK),
UTIL_LEGACY(datadir),