diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-09-20 12:02:05 +0200 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-09-20 12:03:01 +0200 |
commit | e2e701b5747982d037f76021ed64ab15a49cb573 (patch) | |
tree | 6c3a3fad1992be280531aa5e45501e5966bfba08 | |
parent | b590d87b380389371eca94ffb0e6f47f86d1c917 (diff) |
Add SAL_WARN/INFO to network server + remove static reference on exit.
Change-Id: I76e737f59aa36bf7982255fa9bb41ef9d6abfe8d
-rw-r--r-- | sd/source/ui/remotecontrol/Server.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index 388ef9d21305..8ec942d201d5 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -19,6 +19,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/configuration.hxx> +#include <sal/log.hxx> #include "sddll.hxx" @@ -75,23 +76,26 @@ RemoteServer::~RemoteServer() void RemoteServer::execute() { + SAL_INFO( "sdremote", "RemoteServer::execute called" ); osl::SocketAddr aAddr( "0", PORT ); if ( !mSocket.bind( aAddr ) ) { - // Error binding + SAL_WARN( "sdremote", "bind failed" << mSocket.getErrorAsString() ); return; } if ( !mSocket.listen(3) ) { - // Error listening + SAL_WARN( "sdremote", "listen failed" << mSocket.getErrorAsString() ); return; } while ( true ) { StreamSocket aSocket; + SAL_INFO( "sdremote", "waiting on accept" ); if ( mSocket.acceptConnection( aSocket ) == osl_Socket_Error ) { + SAL_WARN( "sdremote", "accept failed" << mSocket.getErrorAsString() ); return; // Closed, or other issue. } BufferedStreamSocket *pSocket = new BufferedStreamSocket( aSocket); @@ -138,6 +142,7 @@ void RemoteServer::execute() axPin >>= sPin; if ( sPin.equals( pClient->mPin ) ) { + SAL_INFO( "sdremote", "client found on validated list -- connecting" ); connectClient( pClient, sPin ); aFound = true; break; @@ -147,13 +152,17 @@ void RemoteServer::execute() } // 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", strlen( "LO_SERVER_VALIDATING_PIN\n\n" ) ); + } } else { + SAL_INFO( "sdremote", "client failed to send LO_SERVER_CLIENT_PAIR, ignoring" ); delete pSocket; } } - + spServer = NULL; // Object is destroyed when Thread::execute() ends. } RemoteServer *sd::RemoteServer::spServer = NULL; @@ -224,6 +233,7 @@ std::vector<ClientInfo*> RemoteServer::getClients() sal_Bool RemoteServer::connectClient( ClientInfo* pClient, rtl::OUString aPin ) { + SAL_INFO( "sdremote", "RemoteServer::connectClient called" ); if ( !spServer ) return false; @@ -285,6 +295,7 @@ sal_Bool RemoteServer::connectClient( ClientInfo* pClient, rtl::OUString aPin ) void SdDLL::RegisterRemotes() { // Disable unless in experimental mode for now + SAL_INFO( "sdremote", "SdDLL::RegisterRemotes called" ); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) return; |