diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/s/client_info.cpp | 24 | ||||
-rw-r--r-- | src/mongo/s/client_info.h | 14 | ||||
-rw-r--r-- | src/mongo/s/request.cpp | 7 |
3 files changed, 5 insertions, 40 deletions
diff --git a/src/mongo/s/client_info.cpp b/src/mongo/s/client_info.cpp index 6413046c96a..09073378a37 100644 --- a/src/mongo/s/client_info.cpp +++ b/src/mongo/s/client_info.cpp @@ -34,6 +34,8 @@ #include "mongo/s/client_info.h" +#include <utility> + #include "mongo/db/auth/authorization_manager_global.h" #include "mongo/db/auth/authorization_session.h" #include "mongo/db/auth/authz_session_external_state_s.h" @@ -51,13 +53,9 @@ namespace mongo { _cur = &_a; _prev = &_b; _autoSplitOk = true; - if (messagingPort) { - _remote = messagingPort->remote(); - } } - ClientInfo::~ClientInfo() { - } + ClientInfo::~ClientInfo() = default; void ClientInfo::addShardHost( const string& shardHost ) { _cur->shardHostsWritten.insert( shardHost ); @@ -74,22 +72,8 @@ namespace mongo { } } - void ClientInfo::newPeerRequest( const HostAndPort& peer ) { - if ( ! _remote.hasPort() ) - _remote = peer; - else if ( _remote != peer ) { - stringstream ss; - ss << "remotes don't match old [" << _remote.toString() << "] new [" << peer.toString() << "]"; - throw UserException( 13134 , ss.str() ); - } - - newRequest(); - } - void ClientInfo::newRequest() { - RequestInfo* temp = _cur; - _cur = _prev; - _prev = temp; + std::swap(_cur, _prev); _cur->clear(); } diff --git a/src/mongo/s/client_info.h b/src/mongo/s/client_info.h index 396bfb80c18..0d97419f89c 100644 --- a/src/mongo/s/client_info.h +++ b/src/mongo/s/client_info.h @@ -54,19 +54,9 @@ namespace mongo { ClientInfo(AbstractMessagingPort* messagingPort); ~ClientInfo(); - /** new request on behalf of a client, adjusts internal state */ - void newPeerRequest( const HostAndPort& peer ); - /** new request not associated (yet or ever) with a client */ void newRequest(); - bool hasRemote() const { return true; } - - /** - * @return remote socket address of the client - */ - HostAndPort getRemote() const { return _remote; } - /** * notes that this client use this shard * keeps track of all shards accessed this request @@ -113,10 +103,6 @@ namespace mongo { static ClientInfo* create(AbstractMessagingPort* messagingPort); private: - - int _id; // unique client id - HostAndPort _remote; // server:port of remote socket end - struct RequestInfo { void clear() { diff --git a/src/mongo/s/request.cpp b/src/mongo/s/request.cpp index e1f6b322f40..d00197c8350 100644 --- a/src/mongo/s/request.cpp +++ b/src/mongo/s/request.cpp @@ -57,12 +57,7 @@ namespace mongo { _id(_m.header().getId()), _didInit(false) { - if (p) { - _clientInfo->newPeerRequest(p->remote()); - } - else { - _clientInfo->newRequest(); - } + _clientInfo->newRequest(); } void Request::init() { |