summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFiona Rowan <fiona.rowan@10gen.com>2017-10-18 13:53:06 -0400
committerFiona Rowan <fiona.rowan@mongodb.com>2017-11-02 12:01:51 -0400
commit5b765943f8e28441d18927cf8182c429c246250c (patch)
treef9846ce526cc81f659bf925ee38a4427c5afd952
parent77c44f1f2cfde4efed4b37f65a406ae3f9e88d0a (diff)
downloadmongo-5b765943f8e28441d18927cf8182c429c246250c.tar.gz
SERVER-31642: Disable compression by default in the shell
-rw-r--r--src/mongo/transport/message_compressor_registry.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/transport/message_compressor_registry.cpp b/src/mongo/transport/message_compressor_registry.cpp
index 2cadfa6f1cb..2722ec3c37c 100644
--- a/src/mongo/transport/message_compressor_registry.cpp
+++ b/src/mongo/transport/message_compressor_registry.cpp
@@ -112,17 +112,18 @@ void MessageCompressorRegistry::setSupportedCompressors(std::vector<std::string>
}
Status addMessageCompressionOptions(moe::OptionSection* options, bool forShell) {
- auto ret =
+ auto& ret =
options
->addOptionChaining("net.compression.compressors",
"networkMessageCompressors",
moe::String,
"Comma-separated list of compressors to use for network messages")
- .setDefault(moe::Value(kDefaultConfigValue.toString()))
.setImplicit(moe::Value(kDisabledConfigValue.toString()));
- if (forShell)
- ret.hidden();
-
+ if (forShell) {
+ ret.setDefault(moe::Value(kDisabledConfigValue.toString())).hidden();
+ } else {
+ ret.setDefault(moe::Value(kDefaultConfigValue.toString()));
+ }
return Status::OK();
}