summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Cotter <matt.cotter@mongodb.com>2016-11-04 12:33:41 -0400
committerMatt Cotter <matt.cotter@mongodb.com>2016-11-07 16:38:08 -0500
commitdfbe4019a5f5a97e712f9992ac9e5e896424ae01 (patch)
treeabea07387a7b63b8b43b5a42a9829c63d3503840
parent5a3a0afc8f27f38c2cd6a455316e5c65a94429fd (diff)
downloadmongo-dfbe4019a5f5a97e712f9992ac9e5e896424ae01.tar.gz
SERVER-26904 correctly parse socketTimeoutMS as ms
-rw-r--r--src/mongo/client/mongo_uri_connect.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/client/mongo_uri_connect.cpp b/src/mongo/client/mongo_uri_connect.cpp
index 140af0fff1d..ac2b8db65c6 100644
--- a/src/mongo/client/mongo_uri_connect.cpp
+++ b/src/mongo/client/mongo_uri_connect.cpp
@@ -165,19 +165,19 @@ BSONObj MongoURI::_makeAuthObjFromOptions(int maxWireVersion) const {
}
DBClientBase* MongoURI::connect(StringData applicationName, std::string& errmsg) const {
- double socketTimeout = 0.0;
+ double socketTimeoutSecs = 0.0;
OptionsMap::const_iterator it = _options.find("socketTimeoutMS");
if (it != _options.end()) {
try {
- socketTimeout = std::stod(it->second);
+ socketTimeoutSecs = std::stod(it->second) / 1000;
} catch (const std::exception& e) {
uasserted(ErrorCodes::BadValue,
str::stream() << "Unable to parse socketTimeoutMS value" << causedBy(e));
}
}
- auto ret = _connectString.connect(applicationName, errmsg, socketTimeout, this);
+ auto ret = _connectString.connect(applicationName, errmsg, socketTimeoutSecs, this);
if (!ret) {
return ret;
}