diff options
| author | Antonin Kral <a.kral@bobek.cz> | 2010-08-18 09:23:15 +0200 |
|---|---|---|
| committer | Antonin Kral <a.kral@bobek.cz> | 2010-08-18 09:23:15 +0200 |
| commit | 3b9581e84e19723087b31b79674801b6c06ae533 (patch) | |
| tree | 5568dbd7199b1ce64ace1cec26b590c1431e872d /client/dbclient.cpp | |
| parent | d7ec8115ec4b160ed74c1a8a06a1c171d76370ac (diff) | |
| download | mongodb-3b9581e84e19723087b31b79674801b6c06ae533.tar.gz | |
Imported Upstream version 1.6.1
Diffstat (limited to 'client/dbclient.cpp')
| -rw-r--r-- | client/dbclient.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/dbclient.cpp b/client/dbclient.cpp index 04b6147..26b1c26 100644 --- a/client/dbclient.cpp +++ b/client/dbclient.cpp @@ -1063,6 +1063,18 @@ namespace mongo { return checkMaster()->findOne(a,b,c,d); } + bool DBClientReplicaSet::isMember( const DBConnector * conn ) const { + if ( conn == this ) + return true; + + for ( unsigned i=0; i<_conns.size(); i++ ) + if ( _conns[i]->isMember( conn ) ) + return true; + + return false; + } + + bool serverAlive( const string &uri ) { DBClientConnection c( false, 0, 20 ); // potentially the connection to server could fail while we're checking if it's alive - so use timeouts string err; |
