]> source.dussan.org Git - tigervnc.git/commitdiff
Handle clients lost during querying
authorPierre Ossman <ossman@cendio.se>
Mon, 18 May 2020 18:27:18 +0000 (20:27 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 21 May 2020 09:34:22 +0000 (11:34 +0200)
unix/x0vncserver/XDesktop.cxx

index 8be9aa3d3a8c7b844f5cd2d7a2e106d9ba92ca0a..eb36467e2d5404b6fbce9cae51b8202d07f1ee6c 100644 (file)
@@ -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)