changed failed to _failed

This commit is contained in:
Eliot Horowitz
2011-03-30 12:16:06 -04:00
parent c16a3b78c4
commit 4e05ef32a1
2 changed files with 14 additions and 14 deletions

View File

@@ -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;