diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-10-05 16:59:22 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-10-09 17:22:17 +0200 |
commit | e6aab2465493d6088c5218d888d9b77d069e514c (patch) | |
tree | f2f6ebc586125dd7e2dc8c47925fcbcc146eef37 /win/winvnc/VNCServerWin32.cxx | |
parent | 4a4453fc69cf56f9991a13a62023969dcf5b8a4f (diff) | |
download | tigervnc-e6aab2465493d6088c5218d888d9b77d069e514c.tar.gz tigervnc-e6aab2465493d6088c5218d888d9b77d069e514c.zip |
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.
Diffstat (limited to 'win/winvnc/VNCServerWin32.cxx')
-rw-r--r-- | win/winvnc/VNCServerWin32.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx index 9f6a954d..93bf5c0a 100644 --- a/win/winvnc/VNCServerWin32.cxx +++ b/win/winvnc/VNCServerWin32.cxx @@ -249,19 +249,19 @@ bool VNCServerWin32::setClientsStatus(rfb::ListConnInfo* LCInfo) { return queueCommand(SetClientsStatus, LCInfo, 0); } -VNCServerST::queryResult VNCServerWin32::queryConnection(network::Socket* sock, - const char* userName, - char** reason) +void VNCServerWin32::queryConnection(network::Socket* sock, + const char* userName) { - if (queryOnlyIfLoggedOn && CurrentUserToken().noUserLoggedOn()) - return VNCServerST::ACCEPT; + if (queryOnlyIfLoggedOn && CurrentUserToken().noUserLoggedOn()) { + vncServer.approveConnection(sock, true, NULL); + return; + } if (queryConnectDialog) { - *reason = rfb::strDup("Another connection is currently being queried."); - return VNCServerST::REJECT; + vncServer.approveConnection(sock, false, "Another connection is currently being queried."); + return; } queryConnectDialog = new QueryConnectDialog(sock, userName, this); queryConnectDialog->startDialog(); - return VNCServerST::PENDING; } void VNCServerWin32::queryConnectionComplete() { |