diff options
author | Andrzej Hunt <andrzej@ahunt.org> | 2021-07-16 18:55:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-17 11:49:20 +0200 |
commit | d6078e02832d13054e6552c6e20277fd1f3e83f6 (patch) | |
tree | 2ebd752489e34fa7d699c9deba62dc4472d1bcda /sd/source | |
parent | fcc4d8e01360baa9ba0bf20eb5e7a1c9af793a02 (diff) |
sdremote: clean up now-unneeded "found" flag
Since ???, this code now lives in a standalone method, allowing
us to return as soon as know that the handshake is complete. This
lets us remove aFound and simplify the code a little.
Change-Id: I51d5281492d2e4280a101e67d606073f4d064c29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119084
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/remotecontrol/Server.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index 6a1716b22e86..e3576bacd52e 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -149,7 +149,6 @@ void RemoteServer::handleAcceptedConnection( BufferedStreamSocket *pSocket ) // Check if we already have this server. Reference< XNameAccess > const xConfig = officecfg::Office::Impress::Misc::AuthorisedRemotes::get(); const Sequence< OUString > aNames = xConfig->getElementNames(); - bool aFound = false; for ( const auto& rName : aNames ) { if ( rName == pClient->mName ) @@ -162,18 +161,14 @@ void RemoteServer::handleAcceptedConnection( BufferedStreamSocket *pSocket ) if ( sPin == pClient->mPin ) { SAL_INFO( "sdremote", "client found on validated list -- connecting" ); connectClient( pClient, sPin ); - aFound = true; - break; + return; } } } // Pin not found so inform the client. - if ( !aFound ) - { - SAL_INFO( "sdremote", "client not found on validated list" ); - pSocket->write( "LO_SERVER_VALIDATING_PIN\n\n", + SAL_INFO( "sdremote", "client not found on validated list" ); + pSocket->write( "LO_SERVER_VALIDATING_PIN\n\n", strlen( "LO_SERVER_VALIDATING_PIN\n\n" ) ); - } } else { SAL_INFO( "sdremote", "client failed to send LO_SERVER_CLIENT_PAIR, ignoring" ); delete pSocket; |