From 63d2fddd6b613406d9ea28dcd5d1c58feb167126 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 4 Oct 2017 15:55:48 +0200 Subject: [PATCH] Don't queue a query if it is directly rejected Otherwise we'll wedge the desktop object which expects an approval or rejection to eventually show up. --- unix/xserver/hw/vnc/XserverDesktop.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 2131db65..dd1d4ca0 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -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; } -- 2.39.5