From 4e05ef32a1b42c90ab77d58ea8e8beeda9928aaa Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Wed, 30 Mar 2011 12:16:06 -0400 Subject: [PATCH] changed failed to _failed --- client/dbclient.cpp | 18 +++++++++--------- client/dbclient.h | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/client/dbclient.cpp b/client/dbclient.cpp index 48fb3a46f9f..03d1a247eff 100644 --- a/client/dbclient.cpp +++ b/client/dbclient.cpp @@ -557,7 +557,7 @@ namespace mongo { p.reset(new MessagingPort( _so_timeout, _logLevel )); if (server->getAddr() == "0.0.0.0") { - failed = true; + _failed = true; return false; } @@ -565,14 +565,14 @@ namespace mongo { stringstream ss; ss << "couldn't connect to server " << _serverString; errmsg = ss.str(); - failed = true; + _failed = true; return false; } return true; } void DBClientConnection::_checkConnection() { - if ( !failed ) + if ( !_failed ) return; if ( lastReconnectTry && time(0)-lastReconnectTry < 2 ) { // we wait a little before reconnect attempt to avoid constant hammering. @@ -585,9 +585,9 @@ namespace mongo { lastReconnectTry = time(0); log(_logLevel) << "trying reconnect to " << _serverString << endl; string errmsg; - failed = false; + _failed = false; if ( ! _connect(errmsg) ) { - failed = true; + _failed = true; log(_logLevel) << "reconnect " << _serverString << " failed " << errmsg << endl; throw SocketException(SocketException::CONNECT_ERROR); } @@ -674,7 +674,7 @@ namespace mongo { /* connection CANNOT be used anymore as more data may be on the way from the server. we have to reconnect. */ - failed = true; + _failed = true; p->shutdown(); throw; } @@ -882,7 +882,7 @@ namespace mongo { port().say( toSend ); } catch( SocketException & ) { - failed = true; + _failed = true; throw; } } @@ -902,7 +902,7 @@ namespace mongo { */ try { if ( !port().call(toSend, response) ) { - failed = true; + _failed = true; if ( assertOk ) uasserted( 10278 , str::stream() << "dbclient error communicating with server: " << getServerAddress() ); @@ -910,7 +910,7 @@ namespace mongo { } } catch( SocketException & ) { - failed = true; + _failed = true; throw; } return true; diff --git a/client/dbclient.h b/client/dbclient.h index 82f0af54077..2c93cd4d31f 100644 --- a/client/dbclient.h +++ b/client/dbclient.h @@ -787,7 +787,7 @@ namespace mongo { Connect timeout is fixed, but short, at 5 seconds. */ DBClientConnection(bool _autoReconnect=false, DBClientReplicaSet* cp=0, double so_timeout=0) : - clientSet(cp), failed(false), autoReconnect(_autoReconnect), lastReconnectTry(0), _so_timeout(so_timeout) { + clientSet(cp), _failed(false), autoReconnect(_autoReconnect), lastReconnectTry(0), _so_timeout(so_timeout) { _numConnections++; } @@ -858,14 +858,14 @@ namespace mongo { @return true if this connection is currently in a failed state. When autoreconnect is on, a connection will transition back to an ok state after reconnecting. */ - bool isFailed() const { return failed; } + bool isFailed() const { return _failed; } MessagingPort& port() { return *p; } string toStringLong() const { stringstream ss; ss << _serverString; - if ( failed ) ss << " failed"; + if ( _failed ) ss << " failed"; return ss.str(); } @@ -897,7 +897,7 @@ namespace mongo { DBClientReplicaSet *clientSet; boost::scoped_ptr p; boost::scoped_ptr server; - bool failed; + bool _failed; const bool autoReconnect; time_t lastReconnectTry; HostAndPort _server; // remember for reconnects @@ -905,7 +905,7 @@ namespace mongo { void _checkConnection(); // throws SocketException if in failed state and not reconnecting or if waiting to reconnect - void checkConnection() { if( failed ) _checkConnection(); } + void checkConnection() { if( _failed ) _checkConnection(); } map< string, pair > authCache; double _so_timeout;