summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient.cpp
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2015-09-18 16:33:26 -0400
committerAdam Midvidy <amidvidy@gmail.com>2015-09-18 17:05:40 -0400
commitcf12c1c392b0fea0341523afe562b4bb3da59305 (patch)
tree7e9b157b70ca048170d1515e282992dbb4c6c7ec /src/mongo/client/dbclient.cpp
parent9378908274d9ff8b37ee7f3f687e9ea0acaf7940 (diff)
downloadmongo-cf12c1c392b0fea0341523afe562b4bb3da59305.tar.gz
SERVER-20498 have metadata writer take the server address
Diffstat (limited to 'src/mongo/client/dbclient.cpp')
-rw-r--r--src/mongo/client/dbclient.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/client/dbclient.cpp b/src/mongo/client/dbclient.cpp
index 77c55d3cf4c..7e0196d7ff5 100644
--- a/src/mongo/client/dbclient.cpp
+++ b/src/mongo/client/dbclient.cpp
@@ -291,11 +291,14 @@ rpc::UniqueReply DBClientWithCommands::runCommandWithMetadata(StringData databas
str::stream() << "Database name '" << database << "' is not valid.",
NamespaceString::validDBName(database));
+ // call() oddly takes this by pointer, so we need to put it on the stack.
+ auto host = getServerAddress();
+
BSONObjBuilder metadataBob;
metadataBob.appendElements(metadata);
if (_metadataWriter) {
- uassertStatusOK(_metadataWriter(&metadataBob));
+ uassertStatusOK(_metadataWriter(&metadataBob, host));
}
auto requestBuilder = rpc::makeRequestBuilder(getClientRPCProtocols(), getServerRPCProtocols());
@@ -307,8 +310,6 @@ rpc::UniqueReply DBClientWithCommands::runCommandWithMetadata(StringData databas
auto requestMsg = requestBuilder->done();
auto replyMsg = stdx::make_unique<Message>();
- // call oddly takes this by pointer, so we need to put it on the stack.
- auto host = getServerAddress();
// We always want to throw if there was a network error, we do it here
// instead of passing 'true' for the 'assertOk' parameter so we can construct a