0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

fix isMaster() broken earlier today

This commit is contained in:
dwight 2009-08-17 17:33:04 -04:00
parent 1a700c121e
commit bc50b778cf

View File

@ -113,12 +113,14 @@ namespace mongo {
inline bool isMaster( const char *client = 0 ) {
if ( !client )
client = database->name.c_str();
if ( replAllDead || slave ) {
return strcmp( client, "local" ) == 0;
}
if ( replPair == 0 || replPair->state == ReplPair::State_Master )
return true;
if ( replAllDead )
return strcmp( client, "local" ) == 0;
if ( replPair ) {
if( replPair->state == ReplPair::State_Master )
return true;
}
return strcmp( client, "local" ) == 0;
}