diff options
author | Pierre Ossman <ossman@cendio.se> | 2020-05-18 20:27:18 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-05-21 11:34:22 +0200 |
commit | 9f623551a7eebfa5d9fa6cc2d369d4b3041fc89d (patch) | |
tree | b9a38597eb874c52a0b3ecd9033f33d26cdd4f11 /unix/x0vncserver | |
parent | 59f0aeaef22404b3156cc4ef986366386d4e4d8c (diff) | |
download | tigervnc-9f623551a7eebfa5d9fa6cc2d369d4b3041fc89d.tar.gz tigervnc-9f623551a7eebfa5d9fa6cc2d369d4b3041fc89d.zip |
Handle clients lost during querying
Diffstat (limited to 'unix/x0vncserver')
-rw-r--r-- | unix/x0vncserver/XDesktop.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index 8be9aa3d..eb36467e 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -288,9 +288,19 @@ void XDesktop::queryConnection(network::Socket* sock, { assert(isRunning()); + // Someone already querying? if (queryConnectSock) { - server->approveConnection(sock, false, "Another connection is currently being queried."); - return; + std::list<network::Socket*> sockets; + std::list<network::Socket*>::iterator i; + + // Check if this socket is still valid + server->getSockets(&sockets); + for (i = sockets.begin(); i != sockets.end(); i++) { + if (*i == queryConnectSock) { + server->approveConnection(sock, false, "Another connection is currently being queried."); + return; + } + } } if (!userName) |