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/SSecurityTLS.cxx b/common/rfb/SSecurityTLS.cxx
index 5576a06..72b83db 100644
--- a/common/rfb/SSecurityTLS.cxx
+++ b/common/rfb/SSecurityTLS.cxx
@@ -49,9 +49,9 @@
static LogWriter vlog("TLS");
-SSecurityTLS::SSecurityTLS(bool _anon) : session(0), dh_params(0),
- anon_cred(0), cert_cred(0),
- anon(_anon), fis(0), fos(0)
+SSecurityTLS::SSecurityTLS(SConnection* sc, bool _anon)
+ : SSecurity(sc), session(NULL), dh_params(NULL), anon_cred(NULL),
+ cert_cred(NULL), anon(_anon), fis(NULL), fos(NULL)
{
certfile = X509_CertFile.getData();
keyfile = X509_KeyFile.getData();
@@ -106,7 +106,7 @@
gnutls_global_deinit();
}
-bool SSecurityTLS::processMsg(SConnection *sc)
+bool SSecurityTLS::processMsg()
{
rdr::InStream* is = sc->getInStream();
rdr::OutStream* os = sc->getOutStream();