Kaydet (Commit) 580b1890 authored tarafından Andrzej Hunt's avatar Andrzej Hunt

Allow removal of remotes even if Server not running.

This is purely config manipulation so shouldn't rely on having
the Server actually running (e.g. if disabled, and/or if network
setup failed).

Change-Id: Ifc6e5639ba6842a18eb0be99387a5f8dd871da06
üst d6146831
...@@ -239,16 +239,16 @@ std::vector< ::boost::shared_ptr< ClientInfo > > RemoteServer::getClients() ...@@ -239,16 +239,16 @@ std::vector< ::boost::shared_ptr< ClientInfo > > RemoteServer::getClients()
{ {
SAL_INFO( "sdremote", "RemoteServer::getClients() called" ); SAL_INFO( "sdremote", "RemoteServer::getClients() called" );
std::vector< ::boost::shared_ptr< ClientInfo > > aClients; std::vector< ::boost::shared_ptr< ClientInfo > > aClients;
if ( !spServer ) if ( spServer )
{ {
SAL_INFO( "sdremote", "No remote server instance => no clients" ); MutexGuard aGuard( sDataMutex );
return aClients; aClients.assign( spServer->mAvailableClients.begin(),
spServer->mAvailableClients.end() );
}
else
{
SAL_INFO( "sdremote", "No remote server instance => no remote clients" );
} }
MutexGuard aGuard( sDataMutex );
aClients.assign( spServer->mAvailableClients.begin(),
spServer->mAvailableClients.end() );
// We also need to provide authorised clients (no matter whether or not // We also need to provide authorised clients (no matter whether or not
// they are actually available), so that they can be de-authorised if // they are actually available), so that they can be de-authorised if
// necessary. We specifically want these to be at the end of the list // necessary. We specifically want these to be at the end of the list
...@@ -342,8 +342,6 @@ void RemoteServer::deauthoriseClient( ::boost::shared_ptr< ClientInfo > pClient ...@@ -342,8 +342,6 @@ void RemoteServer::deauthoriseClient( ::boost::shared_ptr< ClientInfo > pClient
// the UI. // the UI.
SAL_INFO( "sdremote", "RemoteServer::deauthoriseClient called" ); SAL_INFO( "sdremote", "RemoteServer::deauthoriseClient called" );
if ( !spServer )
return;
if ( !pClient->mbIsAlreadyAuthorised ) if ( !pClient->mbIsAlreadyAuthorised )
// We can't remove unauthorised clients from the authorised list... // We can't remove unauthorised clients from the authorised list...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment