From 21c2bb6641f863a8569a9496b9d92aeef2a6bca3 Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Wed, 17 Feb 2016 17:33:44 -0500 Subject: SERVER-22714 MongoURI should use the socketTimeout option --- src/mongo/client/mongo_uri.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/mongo/client/mongo_uri.cpp') 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::parse(const std::string& url) { std::string(optionsTokens[i + 1].begin(), optionsTokens[i + 1].end()); } - std::map::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::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 servers; std::vector servers_split; @@ -148,7 +143,8 @@ StatusWith 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 -- cgit v1.2.1