From: Pierre Ossman Date: Wed, 4 Oct 2017 13:55:48 +0000 (+0200) Subject: Don't queue a query if it is directly rejected X-Git-Tag: v1.8.90~95 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=63d2fddd6b613406d9ea28dcd5d1c58feb167126;p=tigervnc.git 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. --- 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; }