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/SSecurity.h b/common/rfb/SSecurity.h
index 0280574..8ae7902 100644
--- a/common/rfb/SSecurity.h
+++ b/common/rfb/SSecurity.h
@@ -52,8 +52,9 @@
class SSecurity {
public:
+ SSecurity(SConnection* sc) { this->sc = sc; }
virtual ~SSecurity() {}
- virtual bool processMsg(SConnection* sc)=0;
+ virtual bool processMsg() = 0;
virtual int getType() const = 0;
// getUserName() gets the name of the user attempting authentication. The
@@ -63,6 +64,9 @@
virtual const char* getUserName() const = 0;
virtual SConnection::AccessRights getAccessRights() const { return SConnection::AccessDefault; }
+
+ protected:
+ SConnection* sc;
};
}