diff options
Diffstat (limited to 'src/mongo/db/client.cpp')
-rw-r--r-- | src/mongo/db/client.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp index 179b0938d5b..643a25fda05 100644 --- a/src/mongo/db/client.cpp +++ b/src/mongo/db/client.cpp @@ -44,7 +44,6 @@ #include "mongo/db/lasterror.h" #include "mongo/db/service_context.h" #include "mongo/stdx/thread.h" -#include "mongo/transport/session.h" #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/exit.h" #include "mongo/util/mongoutils/str.h" @@ -64,11 +63,13 @@ void Client::initThreadIfNotAlready() { initThreadIfNotAlready(getThreadName().c_str()); } -void Client::initThread(const char* desc, transport::Session* session) { - initThread(desc, getGlobalServiceContext(), session); +void Client::initThread(const char* desc, transport::SessionHandle session) { + initThread(desc, getGlobalServiceContext(), std::move(session)); } -void Client::initThread(const char* desc, ServiceContext* service, transport::Session* session) { +void Client::initThread(const char* desc, + ServiceContext* service, + transport::SessionHandle session) { invariant(currentClient.getMake()->get() == nullptr); std::string fullDesc; @@ -81,7 +82,7 @@ void Client::initThread(const char* desc, ServiceContext* service, transport::Se setThreadName(fullDesc.c_str()); // Create the client obj, attach to thread - *currentClient.get() = service->makeClient(fullDesc, session); + *currentClient.get() = service->makeClient(fullDesc, std::move(session)); } void Client::destroy() { @@ -99,12 +100,12 @@ int64_t generateSeed(const std::string& desc) { } } // namespace -Client::Client(std::string desc, ServiceContext* serviceContext, transport::Session* session) +Client::Client(std::string desc, ServiceContext* serviceContext, transport::SessionHandle session) : _serviceContext(serviceContext), - _session(session), + _session(std::move(session)), _desc(std::move(desc)), _threadId(stdx::this_thread::get_id()), - _connectionId(session ? session->id() : 0), + _connectionId(_session ? _session->id() : 0), _prng(generateSeed(_desc)) {} void Client::reportState(BSONObjBuilder& builder) { |