summaryrefslogtreecommitdiff
path: root/src/mongo/client/mongo_uri.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-02-17 17:33:44 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-02-18 10:52:40 -0500
commit21c2bb6641f863a8569a9496b9d92aeef2a6bca3 (patch)
treef9563e02d9826620ac4cb73be3de7e555ff241a4 /src/mongo/client/mongo_uri.cpp
parent9b3ce6e9fbcefff128189a1ad7259d848203b8ed (diff)
downloadmongo-21c2bb6641f863a8569a9496b9d92aeef2a6bca3.tar.gz
SERVER-22714 MongoURI should use the socketTimeout option
Diffstat (limited to 'src/mongo/client/mongo_uri.cpp')
-rw-r--r--src/mongo/client/mongo_uri.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mongo/client/mongo_uri.cpp b/src/mongo/client/mongo_uri.cpp
index 443a35f9858..6a11c2cace4 100644
--- a/src/mongo/client/mongo_uri.cpp
+++ b/src/mongo/client/mongo_uri.cpp
@@ -114,7 +114,7 @@ StatusWith<MongoURI> MongoURI::parse(const std::string& url) {
std::string(optionsTokens[i + 1].begin(), optionsTokens[i + 1].end());
}
- std::map<std::string, std::string>::const_iterator optIter;
+ OptionsMap::const_iterator optIter;
// If a replica set option was specified, store it in the 'setName' field.
bool haveSetName;
@@ -122,11 +122,6 @@ StatusWith<MongoURI> MongoURI::parse(const std::string& url) {
if ((haveSetName = ((optIter = options.find("replicaSet")) != options.end())))
setName = optIter->second;
- // Add all remaining options into the bson object
- BSONObjBuilder optionsBob;
- for (optIter = options.begin(); optIter != options.end(); ++optIter)
- optionsBob.append(optIter->first, optIter->second);
-
std::string servers_str = matches[3].str();
std::vector<HostAndPort> servers;
std::vector<std::string> servers_split;
@@ -148,7 +143,8 @@ StatusWith<MongoURI> MongoURI::parse(const std::string& url) {
ConnectionString cs(
direct ? ConnectionString::MASTER : ConnectionString::SET, servers, setName);
- return MongoURI(cs, matches[1].str(), matches[2].str(), matches[4].str(), optionsBob.obj());
+ return MongoURI(
+ std::move(cs), matches[1].str(), matches[2].str(), matches[4].str(), std::move(options));
}
} // namespace mongo