aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2020-05-18 19:42:13 +0200
committerPierre Ossman <ossman@cendio.se>2020-05-21 11:34:22 +0200
commit59f0aeaef22404b3156cc4ef986366386d4e4d8c (patch)
treec6e62eceb23694c637b1e7a3c3658ae26938abb4 /common
parent133360184487ce69ed58d72f82b9a5ca161eb1c2 (diff)
downloadtigervnc-59f0aeaef22404b3156cc4ef986366386d4e4d8c.tar.gz
tigervnc-59f0aeaef22404b3156cc4ef986366386d4e4d8c.zip
Separate query and authentication handling
Otherwise we might send duplicate result codes and other weird things.
Diffstat (limited to 'common')
-rw-r--r--common/rfb/SConnection.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index e9dbd665..9e6d0322 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -232,12 +232,8 @@ void SConnection::processSecurityMsg()
{
vlog.debug("processing security message");
try {
- bool done = ssecurity->processMsg();
- if (done) {
- state_ = RFBSTATE_QUERYING;
- setAccessRights(ssecurity->getAccessRights());
- queryConnection(ssecurity->getUserName());
- }
+ if (!ssecurity->processMsg())
+ return;
} catch (AuthFailureException& e) {
vlog.error("AuthFailureException: %s", e.str());
state_ = RFBSTATE_SECURITY_FAILURE;
@@ -246,6 +242,10 @@ void SConnection::processSecurityMsg()
authFailureMsg.replaceBuf(strDup(e.str()));
authFailureTimer.start(100);
}
+
+ state_ = RFBSTATE_QUERYING;
+ setAccessRights(ssecurity->getAccessRights());
+ queryConnection(ssecurity->getUserName());
}
void SConnection::processSecurityFailure()