diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-04-07 14:15:03 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-04-16 16:00:28 -0400 |
commit | a377aa8648de036659bbb4e67c8dfa030299718b (patch) | |
tree | 819d903dfed0d0872ee83421c9c7729382a3cc6c /src/mongo/db/commands/authentication_commands.cpp | |
parent | e5f3146ff48f654dd3883be1e62ee6f0a8549ee8 (diff) | |
download | mongo-a377aa8648de036659bbb4e67c8dfa030299718b.tar.gz |
SERVER-17817 Make AuthenticationSession a decoration on ClientBasic, not a member.
Diffstat (limited to 'src/mongo/db/commands/authentication_commands.cpp')
-rw-r--r-- | src/mongo/db/commands/authentication_commands.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp index 14211985e65..a8fad3c159d 100644 --- a/src/mongo/db/commands/authentication_commands.cpp +++ b/src/mongo/db/commands/authentication_commands.cpp @@ -56,6 +56,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/server_options.h" #include "mongo/platform/random.h" +#include "mongo/stdx/memory.h" #include "mongo/util/concurrency/mutex.h" #include "mongo/util/log.h" #include "mongo/util/md5.hpp" @@ -117,8 +118,9 @@ namespace mongo { stringstream ss; ss << hex << n; result.append("nonce", ss.str() ); - ClientBasic::getCurrent()->resetAuthenticationSession( - new MongoAuthenticationSession(n)); + AuthenticationSession::set( + ClientBasic::getCurrent(), + stdx::make_unique<MongoAuthenticationSession>(n)); return true; } @@ -246,8 +248,8 @@ namespace mongo { { ClientBasic *client = ClientBasic::getCurrent(); - boost::scoped_ptr<AuthenticationSession> session; - client->swapAuthenticationSession(session); + std::unique_ptr<AuthenticationSession> session; + AuthenticationSession::swap(client, session); if (!session || session->getType() != AuthenticationSession::SESSION_TYPE_MONGO) { sleepmillis(30); return Status(ErrorCodes::ProtocolError, "No pending nonce"); |