Strongly bind security objects to connection object
There is already an implicit connection between them, so let's make
it explicit. This allows easy lookup outside of the processMsg() function.
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index ae43254..efc26ac 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -156,7 +156,7 @@
os->writeU32(*i);
if (*i == secTypeNone) os->flush();
state_ = RFBSTATE_SECURITY;
- ssecurity = security.GetSSecurity(*i);
+ ssecurity = security.GetSSecurity(this, *i);
processSecurityMsg();
return;
}
@@ -199,7 +199,7 @@
try {
state_ = RFBSTATE_SECURITY;
- ssecurity = security.GetSSecurity(secType);
+ ssecurity = security.GetSSecurity(this, secType);
} catch (rdr::Exception& e) {
throwConnFailedException("%s", e.str());
}
@@ -211,7 +211,7 @@
{
vlog.debug("processing security message");
try {
- bool done = ssecurity->processMsg(this);
+ bool done = ssecurity->processMsg();
if (done) {
state_ = RFBSTATE_QUERYING;
setAccessRights(ssecurity->getAccessRights());