diff options
author | Billy Donahue <BillyDonahue@users.noreply.github.com> | 2022-07-27 18:17:24 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-27 19:38:08 +0000 |
commit | 958ad9abfc80861d3f43f44da694e83464b01e1d (patch) | |
tree | ca14e7097c1cb8ab20dfad7fa6888511f0226650 /src/mongo/client | |
parent | f8a1ac19be6279e7ace012dafa8cfcaa028d49e1 (diff) | |
download | mongo-958ad9abfc80861d3f43f44da694e83464b01e1d.tar.gz |
SERVER-68246 rewrite calls to boost::optional get and is_initialized
Diffstat (limited to 'src/mongo/client')
-rw-r--r-- | src/mongo/client/authenticate.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/connpool.cpp | 3 | ||||
-rw-r--r-- | src/mongo/client/internal_auth.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/mongo_uri_connect.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/read_preference.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/sasl_aws_client_protocol.cpp | 4 | ||||
-rw-r--r-- | src/mongo/client/sdam/server_selection_json_test_runner.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/server_discovery_monitor_test.cpp | 2 |
8 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/client/authenticate.cpp b/src/mongo/client/authenticate.cpp index 1e4dd8da074..a31dbb54672 100644 --- a/src/mongo/client/authenticate.cpp +++ b/src/mongo/client/authenticate.cpp @@ -378,7 +378,7 @@ SpeculativeAuthType speculateAuth(BSONObjBuilder* isMasterRequest, return SpeculativeAuthType::kNone; } - auto params = std::move(optParams.get()); + auto params = std::move(optParams.value()); auto ret = _speculateAuth(isMasterRequest, mechanism, diff --git a/src/mongo/client/connpool.cpp b/src/mongo/client/connpool.cpp index 67e52f1a1b8..7ab1860e68f 100644 --- a/src/mongo/client/connpool.cpp +++ b/src/mongo/client/connpool.cpp @@ -436,7 +436,8 @@ DBClientBase* DBConnectionPool::get(const string& host, double socketTimeout) { DBClientBase* DBConnectionPool::get(const MongoURI& uri, double socketTimeout) { auto connect = [&] { string errmsg; - std::unique_ptr<DBClientBase> c(uri.connect(uri.getAppName().get(), errmsg, socketTimeout)); + std::unique_ptr<DBClientBase> c( + uri.connect(uri.getAppName().value(), errmsg, socketTimeout)); uassert(40356, fmt::format("{}: connect failed {} : {}", _name, uri.toString(), errmsg), c); return c.release(); }; diff --git a/src/mongo/client/internal_auth.cpp b/src/mongo/client/internal_auth.cpp index 467fb219546..f016f3a4f06 100644 --- a/src/mongo/client/internal_auth.cpp +++ b/src/mongo/client/internal_auth.cpp @@ -78,7 +78,7 @@ BSONObj createInternalX509AuthDocument(boost::optional<StringData> userName) { builder.append(saslCommandUserDBFieldName, "$external"); if (userName) { - builder.append(saslCommandUserFieldName, userName.get()); + builder.append(saslCommandUserFieldName, userName.value()); } return builder.obj(); diff --git a/src/mongo/client/mongo_uri_connect.cpp b/src/mongo/client/mongo_uri_connect.cpp index 331ec055119..1ac571a7e30 100644 --- a/src/mongo/client/mongo_uri_connect.cpp +++ b/src/mongo/client/mongo_uri_connect.cpp @@ -69,7 +69,7 @@ DBClientBase* MongoURI::connect(StringData applicationName, auto optAuthObj = makeAuthObjFromOptions(connection->getMaxWireVersion(), connection->getIsPrimarySaslMechanisms()); if (optAuthObj) { - connection->auth(optAuthObj.get()); + connection->auth(optAuthObj.value()); } } diff --git a/src/mongo/client/read_preference.cpp b/src/mongo/client/read_preference.cpp index 124d7a0ac83..5fd56d8b2ce 100644 --- a/src/mongo/client/read_preference.cpp +++ b/src/mongo/client/read_preference.cpp @@ -255,7 +255,7 @@ void ReadPreferenceSetting::toInnerBSON(BSONObjBuilder* bob) const { bob->append(kMaxStalenessSecondsFieldName, maxStalenessSeconds.count()); } if (hedgingMode) { - bob->append(kHedgeFieldName, hedgingMode.get().toBSON()); + bob->append(kHedgeFieldName, hedgingMode.value().toBSON()); } } diff --git a/src/mongo/client/sasl_aws_client_protocol.cpp b/src/mongo/client/sasl_aws_client_protocol.cpp index 60fb0250816..ae6e6a6596b 100644 --- a/src/mongo/client/sasl_aws_client_protocol.cpp +++ b/src/mongo/client/sasl_aws_client_protocol.cpp @@ -182,9 +182,9 @@ std::string generateClientSecond(StringData serverFirstBase64, if (credentials.sessionToken) { // TODO: move this into kms-message uassertKmsRequest(kms_request_add_header_field( - request.get(), "X-Amz-Security-Token", credentials.sessionToken.get().c_str())); + request.get(), "X-Amz-Security-Token", credentials.sessionToken.value().c_str())); - second.setXAmzSecurityToken(boost::optional<StringData>(credentials.sessionToken.get())); + second.setXAmzSecurityToken(boost::optional<StringData>(credentials.sessionToken.value())); } UniqueKmsCharBuffer kmsSignature(kms_request_get_signature(request.get())); diff --git a/src/mongo/client/sdam/server_selection_json_test_runner.cpp b/src/mongo/client/sdam/server_selection_json_test_runner.cpp index 3c0cfed7532..42610c4366c 100644 --- a/src/mongo/client/sdam/server_selection_json_test_runner.cpp +++ b/src/mongo/client/sdam/server_selection_json_test_runner.cpp @@ -189,7 +189,7 @@ private: return; } - auto newAvgRtt = duration_cast<Milliseconds>(newServerDescription->getRtt().get()); + auto newAvgRtt = duration_cast<Milliseconds>(newServerDescription->getRtt().value()); if (newAvgRtt.compare(duration_cast<Milliseconds>(Milliseconds(_newAvgRtt))) != 0) { std::stringstream errorMessage; errorMessage << "new average RTT is incorrect, got '" << newAvgRtt diff --git a/src/mongo/client/server_discovery_monitor_test.cpp b/src/mongo/client/server_discovery_monitor_test.cpp index 0ab19dc9d2a..d82348a47d5 100644 --- a/src/mongo/client/server_discovery_monitor_test.cpp +++ b/src/mongo/client/server_discovery_monitor_test.cpp @@ -238,7 +238,7 @@ protected: while (elapsed() < deadline) { ASSERT_FALSE(hasReadyRequests()); if (hostAndPort) { - ASSERT_FALSE(_topologyListener->hasIsMasterResponse(hostAndPort.get())); + ASSERT_FALSE(_topologyListener->hasIsMasterResponse(hostAndPort.value())); } advanceTime(Milliseconds(1)); } |