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.
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index 846e97e..52a1113 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -59,7 +59,7 @@
if (rfb::Server::protocol3_3)
defaultMinorVersion = 3;
- cp.setVersion(defaultMajorVersion, defaultMinorVersion);
+ client.setVersion(defaultMajorVersion, defaultMinorVersion);
}
SConnection::~SConnection()
@@ -127,29 +127,29 @@
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 @@
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 @@
}
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 @@
} 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 @@
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 @@
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 @@
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 @@
{
if (!readyForSetColourMapEntries) {
readyForSetColourMapEntries = true;
- if (!cp.pf().trueColour) {
+ if (!client.pf().trueColour) {
writeFakeColourMap();
}
}
@@ -399,7 +399,7 @@
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);
}