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.
diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx
index 9f6a954..93bf5c0 100644
--- a/win/winvnc/VNCServerWin32.cxx
+++ b/win/winvnc/VNCServerWin32.cxx
@@ -249,19 +249,19 @@
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() {