From 7d64b33b5b96a20216a2e1425ff412e027bbebcd Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 8 Oct 2018 15:59:02 +0200 Subject: Move access rights and closing to SConnection object This makes it generally useful and other code doesn't have to know of the specific sub-class. --- common/rfb/SConnection.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'common/rfb/SConnection.h') diff --git a/common/rfb/SConnection.h b/common/rfb/SConnection.h index 47092e35..7148294b 100644 --- a/common/rfb/SConnection.h +++ b/common/rfb/SConnection.h @@ -69,6 +69,13 @@ namespace rfb { void approveConnection(bool accept, const char* reason=0); + // Methods to terminate the connection + + // close() shuts down the connection to the client and awaits + // cleanup of the SConnection object by the server + virtual void close(const char* reason); + + // Overridden from SMsgHandler virtual void setEncodings(int nEncodings, const rdr::S32* encodings); @@ -118,8 +125,10 @@ namespace rfb { virtual void enableContinuousUpdates(bool enable, int x, int y, int w, int h); + // Other methods + // setAccessRights() allows a security package to limit the access rights - // of a VNCSConnectionST to the server. How the access rights are treated + // of a SConnection to the server. How the access rights are treated // is up to the derived class. typedef rdr::U16 AccessRights; @@ -132,9 +141,8 @@ namespace rfb { static const AccessRights AccessDefault; // The default rights, INCLUDING FUTURE ONES static const AccessRights AccessNoQuery; // Connect without local user accepting static const AccessRights AccessFull; // All of the available AND FUTURE rights - virtual void setAccessRights(AccessRights ar) = 0; - - // Other methods + virtual void setAccessRights(AccessRights ar); + virtual bool accessCheck(AccessRights ar) const; // authenticated() returns true if the client has authenticated // successfully. @@ -201,6 +209,7 @@ namespace rfb { SSecurity* ssecurity; stateEnum state_; rdr::S32 preferredEncoding; + AccessRights accessRights; }; } #endif -- cgit v1.2.3