diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-06-18 15:59:00 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-11-01 16:11:42 +0100 |
commit | 0d3ce87f11c7bbafe071a966e78a2921819d2d58 (patch) | |
tree | ec4613a3bc3579a9c1e15f9a30adfaf90e0f0705 /common/rfb/SConnection.cxx | |
parent | b14a6bc1aacc3238a1e318d9f165d25674f34d45 (diff) | |
download | tigervnc-0d3ce87f11c7bbafe071a966e78a2921819d2d58.tar.gz tigervnc-0d3ce87f11c7bbafe071a966e78a2921819d2d58.zip |
Rename ConnParams to ClientParams
Now that we've split out server state to ServerParams, ConnParams
only contains state for a client. Rename the class and variables
to reflect this.
Diffstat (limited to 'common/rfb/SConnection.cxx')
-rw-r--r-- | common/rfb/SConnection.cxx | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx index 846e97e4..52a1113d 100644 --- a/common/rfb/SConnection.cxx +++ b/common/rfb/SConnection.cxx @@ -59,7 +59,7 @@ SConnection::SConnection() if (rfb::Server::protocol3_3) defaultMinorVersion = 3; - cp.setVersion(defaultMajorVersion, defaultMinorVersion); + client.setVersion(defaultMajorVersion, defaultMinorVersion); } SConnection::~SConnection() @@ -127,29 +127,29 @@ void SConnection::processVersionMsg() throw Exception("reading version failed: not an RFB client?"); } - cp.setVersion(majorVersion, minorVersion); + client.setVersion(majorVersion, minorVersion); vlog.info("Client needs protocol version %d.%d", - cp.majorVersion, cp.minorVersion); + client.majorVersion, client.minorVersion); - if (cp.majorVersion != 3) { + if (client.majorVersion != 3) { // unknown protocol version throwConnFailedException("Client needs protocol version %d.%d, server has %d.%d", - cp.majorVersion, cp.minorVersion, + client.majorVersion, client.minorVersion, defaultMajorVersion, defaultMinorVersion); } - if (cp.minorVersion != 3 && cp.minorVersion != 7 && cp.minorVersion != 8) { + if (client.minorVersion != 3 && client.minorVersion != 7 && client.minorVersion != 8) { vlog.error("Client uses unofficial protocol version %d.%d", - cp.majorVersion,cp.minorVersion); - if (cp.minorVersion >= 8) - cp.minorVersion = 8; - else if (cp.minorVersion == 7) - cp.minorVersion = 7; + client.majorVersion,client.minorVersion); + if (client.minorVersion >= 8) + client.minorVersion = 8; + else if (client.minorVersion == 7) + client.minorVersion = 7; else - cp.minorVersion = 3; + client.minorVersion = 3; vlog.error("Assuming compatibility with version %d.%d", - cp.majorVersion,cp.minorVersion); + client.majorVersion,client.minorVersion); } versionReceived(); @@ -158,7 +158,7 @@ void SConnection::processVersionMsg() std::list<rdr::U8>::iterator i; secTypes = security.GetEnabledSecTypes(); - if (cp.isVersion(3,3)) { + if (client.isVersion(3,3)) { // cope with legacy 3.3 client only if "no authentication" or "vnc // authentication" is supported. @@ -167,7 +167,7 @@ void SConnection::processVersionMsg() } if (i == secTypes.end()) { throwConnFailedException("No supported security type for %d.%d client", - cp.majorVersion, cp.minorVersion); + client.majorVersion, client.minorVersion); } os->writeU32(*i); @@ -237,7 +237,7 @@ void SConnection::processSecurityMsg() } catch (AuthFailureException& e) { vlog.error("AuthFailureException: %s", e.str()); os->writeU32(secResultFailed); - if (!cp.beforeVersion(3,8)) // 3.8 onwards have failure message + if (!client.beforeVersion(3,8)) // 3.8 onwards have failure message os->writeString(e.str()); os->flush(); throw; @@ -262,7 +262,7 @@ void SConnection::throwConnFailedException(const char* format, ...) vlog.info("Connection failed: %s", str); if (state_ == RFBSTATE_PROTOCOL_VERSION) { - if (cp.majorVersion == 3 && cp.minorVersion == 3) { + if (client.majorVersion == 3 && client.minorVersion == 3) { os->writeU32(0); os->writeString(str); os->flush(); @@ -324,12 +324,12 @@ void SConnection::approveConnection(bool accept, const char* reason) if (state_ != RFBSTATE_QUERYING) throw Exception("SConnection::approveConnection: invalid state"); - if (!cp.beforeVersion(3,8) || ssecurity->getType() != secTypeNone) { + if (!client.beforeVersion(3,8) || ssecurity->getType() != secTypeNone) { if (accept) { os->writeU32(secResultOK); } else { os->writeU32(secResultFailed); - if (!cp.beforeVersion(3,8)) { // 3.8 onwards have failure message + if (!client.beforeVersion(3,8)) { // 3.8 onwards have failure message if (reason) os->writeString(reason); else @@ -342,7 +342,7 @@ void SConnection::approveConnection(bool accept, const char* reason) if (accept) { state_ = RFBSTATE_INITIALISATION; reader_ = new SMsgReader(this, is); - writer_ = new SMsgWriter(&cp, os); + writer_ = new SMsgWriter(&client, os); authSuccess(); } else { state_ = RFBSTATE_INVALID; @@ -371,7 +371,7 @@ void SConnection::framebufferUpdateRequest(const Rect& r, bool incremental) { if (!readyForSetColourMapEntries) { readyForSetColourMapEntries = true; - if (!cp.pf().trueColour) { + if (!client.pf().trueColour) { writeFakeColourMap(); } } @@ -399,7 +399,7 @@ void SConnection::writeFakeColourMap(void) rdr::U16 red[256], green[256], blue[256]; for (i = 0;i < 256;i++) - cp.pf().rgbFromPixel(i, &red[i], &green[i], &blue[i]); + client.pf().rgbFromPixel(i, &red[i], &green[i], &blue[i]); writer()->writeSetColourMapEntries(0, 256, red, green, blue); } |