diff options
Diffstat (limited to 'src/lib/barrier')
| -rw-r--r-- | src/lib/barrier/ClientApp.cpp | 4 | ||||
| -rw-r--r-- | src/lib/barrier/PlatformScreen.h | 2 | ||||
| -rw-r--r-- | src/lib/barrier/ProtocolUtil.cpp | 3 | ||||
| -rw-r--r-- | src/lib/barrier/ProtocolUtil.h | 6 | ||||
| -rw-r--r-- | src/lib/barrier/ServerApp.cpp | 13 | ||||
| -rw-r--r-- | src/lib/barrier/StreamChunker.cpp | 2 | ||||
| -rw-r--r-- | src/lib/barrier/XBarrier.cpp | 30 | ||||
| -rw-r--r-- | src/lib/barrier/XBarrier.h | 34 | ||||
| -rw-r--r-- | src/lib/barrier/XScreen.cpp | 11 | ||||
| -rw-r--r-- | src/lib/barrier/XScreen.h | 4 | ||||
| -rw-r--r-- | src/lib/barrier/win32/DaemonApp.cpp | 5 |
11 files changed, 54 insertions, 60 deletions
diff --git a/src/lib/barrier/ClientApp.cpp b/src/lib/barrier/ClientApp.cpp index a91312d..b1a7661 100644 --- a/src/lib/barrier/ClientApp.cpp +++ b/src/lib/barrier/ClientApp.cpp @@ -282,7 +282,9 @@ ClientApp::scheduleClientRestart(double retryTime) void ClientApp::handleClientConnected(const Event&, void*) { - LOG((CLOG_NOTE "connected to server")); + // using CLOG_PRINT here allows the GUI to see that the client is connected + // regardless of which log level is set + LOG((CLOG_PRINT "connected to server")); resetRestartTimeout(); updateStatus(); } diff --git a/src/lib/barrier/PlatformScreen.h b/src/lib/barrier/PlatformScreen.h index 82cbfaa..38bf8de 100644 --- a/src/lib/barrier/PlatformScreen.h +++ b/src/lib/barrier/PlatformScreen.h @@ -20,7 +20,7 @@ #include "barrier/IPlatformScreen.h"
#include "barrier/DragInformation.h"
-#include "common/stdexcept.h"
+#include <stdexcept>
//! Base screen implementation
/*!
diff --git a/src/lib/barrier/ProtocolUtil.cpp b/src/lib/barrier/ProtocolUtil.cpp index 42fe69c..e742687 100644 --- a/src/lib/barrier/ProtocolUtil.cpp +++ b/src/lib/barrier/ProtocolUtil.cpp @@ -20,6 +20,7 @@ #include "io/IStream.h" #include "base/Log.h" #include "common/stdvector.h" +#include "base/String.h" #include <cctype> #include <cstring> @@ -538,7 +539,7 @@ ProtocolUtil::read(barrier::IStream* stream, void* vbuffer, UInt32 count) // String -XIOReadMismatch::getWhat() const throw() +XIOReadMismatch::getWhat() const noexcept { return format("XIOReadMismatch", "ProtocolUtil::readf() mismatch"); } diff --git a/src/lib/barrier/ProtocolUtil.h b/src/lib/barrier/ProtocolUtil.h index 78bb5ca..9930cfc 100644 --- a/src/lib/barrier/ProtocolUtil.h +++ b/src/lib/barrier/ProtocolUtil.h @@ -47,7 +47,7 @@ public: - \%1I -- converts std::vector<UInt8>* to 1 byte integers - \%2I -- converts std::vector<UInt16>* to 2 byte integers in NBO - \%4I -- converts std::vector<UInt32>* to 4 byte integers in NBO - - \%s -- converts String* to stream of bytes + - \%s -- converts std::string* to stream of bytes - \%S -- converts integer N and const UInt8* to stream of N bytes */ static void writef(barrier::IStream*, @@ -67,7 +67,7 @@ public: - \%1I -- reads 1 byte integers; arg is std::vector<UInt8>* - \%2I -- reads NBO 2 byte integers; arg is std::vector<UInt16>* - \%4I -- reads NBO 4 byte integers; arg is std::vector<UInt32>* - - \%s -- reads bytes; argument must be a String*, \b not a char* + - \%s -- reads bytes; argument must be a std::string*, \b not a char* */ static bool readf(barrier::IStream*, const char* fmt, ...); @@ -92,5 +92,5 @@ match the format. class XIOReadMismatch : public XIO { public: // XBase overrides - virtual String getWhat() const throw(); + virtual std::string getWhat() const noexcept; }; diff --git a/src/lib/barrier/ServerApp.cpp b/src/lib/barrier/ServerApp.cpp index 318673c..18cf935 100644 --- a/src/lib/barrier/ServerApp.cpp +++ b/src/lib/barrier/ServerApp.cpp @@ -555,15 +555,18 @@ ServerApp::startServer() m_server->setListener(listener); m_listener = listener; updateStatus(); - LOG((CLOG_NOTE "started server (%s), waiting for clients", family)); + + // using CLOG_PRINT here allows the GUI to see that the server is started + // regardless of which log level is set + LOG((CLOG_PRINT "started server (%s), waiting for clients", family)); m_serverState = kStarted; return true; } catch (XSocketAddressInUse& e) { - LOG((CLOG_WARN "cannot listen for clients: %s", e.what())); + LOG((CLOG_ERR "cannot listen for clients: %s", e.what())); closeClientListener(listener); updateStatus(String("cannot listen for clients: ") + e.what()); - retryTime = 10.0; + retryTime = 1.0; } catch (XBase& e) { LOG((CLOG_CRIT "failed to start server: %s", e.what())); @@ -684,9 +687,9 @@ ServerApp::handleNoClients(const Event&, void*) void ServerApp::handleScreenSwitched(const Event& e, void*) { - Server::SwitchToScreenInfo* info = (Server::SwitchToScreenInfo*)(e.getData()); - #ifdef WINAPI_XWINDOWS + Server::SwitchToScreenInfo* info = (Server::SwitchToScreenInfo*)(e.getData()); + if (!args().m_screenChangeScript.empty()) { LOG((CLOG_INFO "Running shell script for screen \"%s\"", info->m_screen)); diff --git a/src/lib/barrier/StreamChunker.cpp b/src/lib/barrier/StreamChunker.cpp index 8b8971c..579d02f 100644 --- a/src/lib/barrier/StreamChunker.cpp +++ b/src/lib/barrier/StreamChunker.cpp @@ -29,9 +29,9 @@ #include "base/Log.h" #include "base/Stopwatch.h" #include "base/String.h" -#include "common/stdexcept.h" #include <fstream> +#include <stdexcept> using namespace std; diff --git a/src/lib/barrier/XBarrier.cpp b/src/lib/barrier/XBarrier.cpp index 49a015e..7fe3577 100644 --- a/src/lib/barrier/XBarrier.cpp +++ b/src/lib/barrier/XBarrier.cpp @@ -23,8 +23,7 @@ // XBadClient // -String -XBadClient::getWhat() const throw() +String XBadClient::getWhat() const noexcept { return "XBadClient"; } @@ -41,20 +40,17 @@ XIncompatibleClient::XIncompatibleClient(int major, int minor) : // do nothing } -int -XIncompatibleClient::getMajor() const throw() +int XIncompatibleClient::getMajor() const noexcept { return m_major; } -int -XIncompatibleClient::getMinor() const throw() +int XIncompatibleClient::getMinor() const noexcept { return m_minor; } -String -XIncompatibleClient::getWhat() const throw() +String XIncompatibleClient::getWhat() const noexcept { return format("XIncompatibleClient", "incompatible client %{1}.%{2}", barrier::string::sprintf("%d", m_major).c_str(), @@ -72,14 +68,12 @@ XDuplicateClient::XDuplicateClient(const String& name) : // do nothing } -const String& -XDuplicateClient::getName() const throw() +const String& XDuplicateClient::getName() const noexcept { return m_name; } -String -XDuplicateClient::getWhat() const throw() +String XDuplicateClient::getWhat() const noexcept { return format("XDuplicateClient", "duplicate client %{1}", m_name.c_str()); } @@ -95,14 +89,12 @@ XUnknownClient::XUnknownClient(const String& name) : // do nothing } -const String& -XUnknownClient::getName() const throw() +const String& XUnknownClient::getName() const noexcept { return m_name; } -String -XUnknownClient::getWhat() const throw() +String XUnknownClient::getWhat() const noexcept { return format("XUnknownClient", "unknown client %{1}", m_name.c_str()); } @@ -118,14 +110,12 @@ XExitApp::XExitApp(int code) : // do nothing } -int -XExitApp::getCode() const throw() +int XExitApp::getCode() const noexcept { return m_code; } -String -XExitApp::getWhat() const throw() +String XExitApp::getWhat() const noexcept { return format( "XExitApp", "exiting with code %{1}", diff --git a/src/lib/barrier/XBarrier.h b/src/lib/barrier/XBarrier.h index fdf5213..fef931e 100644 --- a/src/lib/barrier/XBarrier.h +++ b/src/lib/barrier/XBarrier.h @@ -47,14 +47,14 @@ public: //@{ //! Get client's major version number - int getMajor() const throw(); + int getMajor() const noexcept; //! Get client's minor version number - int getMinor() const throw(); + int getMinor() const noexcept; //@} protected: - virtual String getWhat() const throw(); + virtual std::string getWhat() const noexcept; private: int m_major; @@ -68,23 +68,22 @@ a client that is already connected. */ class XDuplicateClient : public XBarrier { public: - XDuplicateClient(const String& name); - virtual ~XDuplicateClient() _NOEXCEPT { } + XDuplicateClient(const std::string& name); + virtual ~XDuplicateClient() noexcept { } //! @name accessors //@{ //! Get client's name - virtual const String& - getName() const throw(); + virtual const std::string& getName() const noexcept; //@} protected: - virtual String getWhat() const throw(); + virtual std::string getWhat() const noexcept; private: - String m_name; + std::string m_name; }; //! Client not in map exception @@ -94,23 +93,22 @@ unknown to the server. */ class XUnknownClient : public XBarrier { public: - XUnknownClient(const String& name); - virtual ~XUnknownClient() _NOEXCEPT { } + XUnknownClient(const std::string& name); + virtual ~XUnknownClient() noexcept { } //! @name accessors //@{ //! Get the client's name - virtual const String& - getName() const throw(); + virtual const std::string& getName() const noexcept; //@} protected: - virtual String getWhat() const throw(); + virtual std::string getWhat() const noexcept; private: - String m_name; + std::string m_name; }; //! Generic exit eception @@ -122,13 +120,13 @@ exit(int). class XExitApp : public XBarrier { public: XExitApp(int code); - virtual ~XExitApp() _NOEXCEPT { } + virtual ~XExitApp() noexcept { } //! Get the exit code - int getCode() const throw(); + int getCode() const noexcept; protected: - virtual String getWhat() const throw(); + virtual std::string getWhat() const noexcept; private: int m_code; diff --git a/src/lib/barrier/XScreen.cpp b/src/lib/barrier/XScreen.cpp index a202240..3398423 100644 --- a/src/lib/barrier/XScreen.cpp +++ b/src/lib/barrier/XScreen.cpp @@ -22,8 +22,7 @@ // XScreenOpenFailure // -String -XScreenOpenFailure::getWhat() const throw() +std::string XScreenOpenFailure::getWhat() const noexcept { return format("XScreenOpenFailure", "unable to open screen"); } @@ -33,8 +32,7 @@ XScreenOpenFailure::getWhat() const throw() // XScreenXInputFailure // -String -XScreenXInputFailure::getWhat() const throw() +std::string XScreenXInputFailure::getWhat() const noexcept { return ""; } @@ -50,7 +48,7 @@ XScreenUnavailable::XScreenUnavailable(double timeUntilRetry) : // do nothing } -XScreenUnavailable::~XScreenUnavailable() _NOEXCEPT +XScreenUnavailable::~XScreenUnavailable() noexcept { // do nothing } @@ -61,8 +59,7 @@ XScreenUnavailable::getRetryTime() const return m_timeUntilRetry; } -String -XScreenUnavailable::getWhat() const throw() +std::string XScreenUnavailable::getWhat() const noexcept { return format("XScreenUnavailable", "unable to open screen"); } diff --git a/src/lib/barrier/XScreen.h b/src/lib/barrier/XScreen.h index 0cb511e..f8fe7a7 100644 --- a/src/lib/barrier/XScreen.h +++ b/src/lib/barrier/XScreen.h @@ -47,7 +47,7 @@ public: trying to open the screen again. */ XScreenUnavailable(double timeUntilRetry); - virtual ~XScreenUnavailable() _NOEXCEPT; + virtual ~XScreenUnavailable() noexcept; //! @name manipulators //@{ @@ -61,7 +61,7 @@ public: //@} protected: - virtual String getWhat() const throw(); + virtual std::string getWhat() const noexcept; private: double m_timeUntilRetry; diff --git a/src/lib/barrier/win32/DaemonApp.cpp b/src/lib/barrier/win32/DaemonApp.cpp index eafd893..482c465 100644 --- a/src/lib/barrier/win32/DaemonApp.cpp +++ b/src/lib/barrier/win32/DaemonApp.cpp @@ -353,7 +353,10 @@ DaemonApp::handleIpcMessage(const Event& e, void*) LOG((CLOG_DEBUG "ipc hello, type=%s", type.c_str())); const char * serverstatus = m_watchdog->isProcessActive() ? "active" : "not active"; - LOG((CLOG_INFO "server status: %s", serverstatus)); + + // using CLOG_PRINT here allows the GUI to see that the server status + // regardless of which log level is set + LOG((CLOG_PRINT "server status: %s", serverstatus)); m_ipcLogOutputter->notifyBuffer(); break; |
