From e6aab2465493d6088c5218d888d9b77d069e514c Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 5 Oct 2018 16:59:22 +0200 Subject: Force common flow of connection queries Force queryConnection() to always call back to approveConnection() rather than return special values. This makes the flow easier to follow as it will be the same in all cases. --- unix/x0vncserver/x0vncserver.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'unix/x0vncserver') diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index c08572be..9b84ca29 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -87,12 +87,11 @@ public: ~QueryConnHandler() { delete queryConnectDialog; } // -=- VNCServerST::QueryConnectionHandler interface - virtual VNCServerST::queryResult queryConnection(network::Socket* sock, - const char* userName, - char** reason) { + virtual void queryConnection(network::Socket* sock, + const char* userName) { if (queryConnectSock) { - *reason = strDup("Another connection is currently being queried."); - return VNCServerST::REJECT; + server->approveConnection(sock, false, "Another connection is currently being queried."); + return; } if (!userName) userName = "(anonymous)"; queryConnectSock = sock; @@ -102,7 +101,6 @@ public: userName, queryConnectTimeout, this); queryConnectDialog->map(); - return VNCServerST::PENDING; } // -=- QueryResultCallback interface -- cgit v1.2.3