summaryrefslogtreecommitdiff
path: root/src/mongo/shell/shell_utils.cpp
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2015-06-24 13:54:45 -0400
committerAdam Midvidy <amidvidy@gmail.com>2015-06-24 15:50:30 -0400
commit1fc9cba6988ab1b600be1a0549caf6146619e4df (patch)
treea5fcf53a04666b1bfc2ca43332cd824894154985 /src/mongo/shell/shell_utils.cpp
parent313c3bdc2547f2746639e84f8668a756ad95d8f3 (diff)
downloadmongo-1fc9cba6988ab1b600be1a0549caf6146619e4df.tar.gz
SERVER-19035 autodetect support for OP_COMMAND in remote servers
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
-rw-r--r--src/mongo/shell/shell_utils.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp
index 81dd1d5225f..36f6daa4d2d 100644
--- a/src/mongo/shell/shell_utils.cpp
+++ b/src/mongo/shell/shell_utils.cpp
@@ -352,7 +352,12 @@ void onConnect(DBClientWithCommands& c) {
if (_nokillop) {
return;
}
- c.setClientRPCProtocols(shellGlobalParams.rpcProtocols);
+
+ // Only override the default rpcProtocols if they were set on the command line.
+ if (shellGlobalParams.rpcProtocols) {
+ c.setClientRPCProtocols(*shellGlobalParams.rpcProtocols);
+ }
+
connectionRegistry.registerConnection(c);
}