]> source.dussan.org Git - tigervnc.git/commitdiff
Don't queue a query if it is directly rejected
authorPierre Ossman <ossman@cendio.se>
Wed, 4 Oct 2017 13:55:48 +0000 (15:55 +0200)
committerPierre Ossman <ossman@cendio.se>
Wed, 4 Oct 2017 13:55:48 +0000 (15:55 +0200)
Otherwise we'll wedge the desktop object which expects an approval
or rejection to eventually show up.

unix/xserver/hw/vnc/XserverDesktop.cc

index 2131db65347989c6ff12bf069f763256f2da5fea..dd1d4ca02055a9e09662078ceebe5d464de8782a 100644 (file)
@@ -306,6 +306,12 @@ XserverDesktop::queryConnection(network::Socket* sock,
     return rfb::VNCServerST::REJECT;
   }
 
+  count = vncNotifyQueryConnect();
+  if (count == 0) {
+    *reason = strDup("Unable to query the local user to accept the connection.");
+    return rfb::VNCServerST::REJECT;
+  }
+
   queryConnectAddress.replaceBuf(sock->getPeerAddress());
   if (!userName)
     userName = "(anonymous)";
@@ -313,12 +319,6 @@ XserverDesktop::queryConnection(network::Socket* sock,
   queryConnectId = (uint32_t)(intptr_t)sock;
   queryConnectSocket = sock;
 
-  count = vncNotifyQueryConnect();
-  if (count == 0) {
-    *reason = strDup("Unable to query the local user to accept the connection.");
-    return rfb::VNCServerST::REJECT;
-  }
-
   return rfb::VNCServerST::PENDING;
 }