diff --git a/s/d_logic.h b/s/d_logic.h index 2a0dbd188ce..c83f0f8a901 100644 --- a/s/d_logic.h +++ b/s/d_logic.h @@ -64,7 +64,7 @@ namespace mongo { void enable( const string& server ); void gotShardName( const string& name ); - void gotShardHost( const string& host ); + void gotShardHost( string host ); bool hasVersion( const string& ns ); bool hasVersion( const string& ns , ConfigVersion& version ); diff --git a/s/d_state.cpp b/s/d_state.cpp index ecc7db986fd..acb68656ce9 100644 --- a/s/d_state.cpp +++ b/s/d_state.cpp @@ -76,7 +76,12 @@ namespace mongo { uasserted( 13298 , ss.str() ); } - void ShardingState::gotShardHost( const string& host ){ + void ShardingState::gotShardHost( string host ){ + + size_t slash = host.find( '/' ); + if ( slash != string::npos ) + host = host.substr( 0 , slash ); + if ( _shardHost.size() == 0 ){ _shardHost = host; return;