diff options
Diffstat (limited to 'common/rfb')
-rw-r--r-- | common/rfb/SSecurityRSAAES.cxx | 5 | ||||
-rw-r--r-- | common/rfb/VNCSConnectionST.cxx | 3 | ||||
-rw-r--r-- | common/rfb/VNCServerST.cxx | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/common/rfb/SSecurityRSAAES.cxx b/common/rfb/SSecurityRSAAES.cxx index 5b3a04d2..92b332d6 100644 --- a/common/rfb/SSecurityRSAAES.cxx +++ b/common/rfb/SSecurityRSAAES.cxx @@ -24,6 +24,7 @@ #error "This source should not be compiled without HAVE_NETTLE defined" #endif +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <assert.h> @@ -155,7 +156,7 @@ void SSecurityRSAAES::loadPrivateKey() { FILE* file = fopen(keyFile, "rb"); if (!file) - throw Exception("failed to open key file"); + throw rdr::SystemException("failed to open key file", errno); fseek(file, 0, SEEK_END); size_t size = ftell(file); if (size == 0 || size > MaxKeyFileSize) { @@ -166,7 +167,7 @@ void SSecurityRSAAES::loadPrivateKey() std::vector<uint8_t> data(size); if (fread(data.data(), 1, data.size(), file) != size) { fclose(file); - throw Exception("failed to read key"); + throw rdr::SystemException("failed to read key", errno); } fclose(file); diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index 88deff8c..7dc2a0b8 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -83,9 +83,6 @@ VNCSConnectionST::~VNCSConnectionST() vlog.info("closing %s: %s", peerEndpoint.c_str(), closeReason.c_str()); - // Release any mouse buttons - server->pointerEvent(this, server->getCursorPos(), 0); - // Release any keys the client still had pressed while (!pressedKeys.empty()) { uint32_t keysym, keycode; diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index 114ff347..66b05fae 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -176,8 +176,11 @@ void VNCServerST::removeSocket(network::Socket* sock) { for (ci = clients.begin(); ci != clients.end(); ci++) { if ((*ci)->getSock() == sock) { // - Remove any references to it - if (pointerClient == *ci) + if (pointerClient == *ci) { + // Release the mouse buttons the client have pressed + desktop->pointerEvent(cursorPos, 0); pointerClient = nullptr; + } if (clipboardClient == *ci) handleClipboardAnnounce(*ci, false); clipboardRequestors.remove(*ci); |