CSecurityStack.cxx
CSecurityVeNCrypt.cxx
CSecurityVncAuth.cxx
+ ClientParams.cxx
ComparingUpdateTracker.cxx
Configuration.cxx
- ConnParams.cxx
CopyRectDecoder.cxx
Cursor.cxx
DecodeManager.cxx
--- /dev/null
+/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright (C) 2011 D. R. Commander. All Rights Reserved.
+ * Copyright 2014-2018 Pierre Ossman for Cendio AB
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+#include <rfb/Exception.h>
+#include <rfb/encodings.h>
+#include <rfb/ledStates.h>
+#include <rfb/ClientParams.h>
+
+using namespace rfb;
+
+ClientParams::ClientParams()
+ : majorVersion(0), minorVersion(0),
+ useCopyRect(false),
+ supportsLocalCursor(false), supportsLocalXCursor(false),
+ supportsLocalCursorWithAlpha(false),
+ supportsDesktopResize(false), supportsExtendedDesktopSize(false),
+ supportsDesktopRename(false), supportsLastRect(false),
+ supportsLEDState(false), supportsQEMUKeyEvent(false),
+ supportsSetDesktopSize(false), supportsFence(false),
+ supportsContinuousUpdates(false),
+ compressLevel(2), qualityLevel(-1), fineQualityLevel(-1),
+ subsampling(subsampleUndefined),
+ width_(0), height_(0), name_(0),
+ ledState_(ledUnknown)
+{
+ setName("");
+ cursor_ = new Cursor(0, 0, Point(), NULL);
+}
+
+ClientParams::~ClientParams()
+{
+ delete [] name_;
+ delete cursor_;
+}
+
+void ClientParams::setDimensions(int width, int height)
+{
+ ScreenSet layout;
+ layout.add_screen(rfb::Screen(0, 0, 0, width, height, 0));
+ setDimensions(width, height, layout);
+}
+
+void ClientParams::setDimensions(int width, int height, const ScreenSet& layout)
+{
+ if (!layout.validate(width, height))
+ throw Exception("Attempted to configure an invalid screen layout");
+
+ width_ = width;
+ height_ = height;
+ screenLayout_ = layout;
+}
+
+void ClientParams::setPF(const PixelFormat& pf)
+{
+ pf_ = pf;
+
+ if (pf.bpp != 8 && pf.bpp != 16 && pf.bpp != 32)
+ throw Exception("setPF: not 8, 16 or 32 bpp?");
+}
+
+void ClientParams::setName(const char* name)
+{
+ delete [] name_;
+ name_ = strDup(name);
+}
+
+void ClientParams::setCursor(const Cursor& other)
+{
+ delete cursor_;
+ cursor_ = new Cursor(other);
+}
+
+bool ClientParams::supportsEncoding(rdr::S32 encoding) const
+{
+ return encodings_.count(encoding) != 0;
+}
+
+void ClientParams::setEncodings(int nEncodings, const rdr::S32* encodings)
+{
+ useCopyRect = false;
+ supportsLocalCursor = false;
+ supportsLocalCursorWithAlpha = false;
+ supportsDesktopResize = false;
+ supportsExtendedDesktopSize = false;
+ supportsLocalXCursor = false;
+ supportsLastRect = false;
+ supportsQEMUKeyEvent = false;
+ compressLevel = -1;
+ qualityLevel = -1;
+ fineQualityLevel = -1;
+ subsampling = subsampleUndefined;
+
+ encodings_.clear();
+ encodings_.insert(encodingRaw);
+
+ for (int i = nEncodings-1; i >= 0; i--) {
+ switch (encodings[i]) {
+ case encodingCopyRect:
+ useCopyRect = true;
+ break;
+ case pseudoEncodingCursor:
+ supportsLocalCursor = true;
+ break;
+ case pseudoEncodingXCursor:
+ supportsLocalXCursor = true;
+ break;
+ case pseudoEncodingCursorWithAlpha:
+ supportsLocalCursorWithAlpha = true;
+ break;
+ case pseudoEncodingDesktopSize:
+ supportsDesktopResize = true;
+ break;
+ case pseudoEncodingExtendedDesktopSize:
+ supportsExtendedDesktopSize = true;
+ break;
+ case pseudoEncodingDesktopName:
+ supportsDesktopRename = true;
+ break;
+ case pseudoEncodingLastRect:
+ supportsLastRect = true;
+ break;
+ case pseudoEncodingLEDState:
+ supportsLEDState = true;
+ break;
+ case pseudoEncodingQEMUKeyEvent:
+ supportsQEMUKeyEvent = true;
+ break;
+ case pseudoEncodingFence:
+ supportsFence = true;
+ break;
+ case pseudoEncodingContinuousUpdates:
+ supportsContinuousUpdates = true;
+ break;
+ case pseudoEncodingSubsamp1X:
+ subsampling = subsampleNone;
+ break;
+ case pseudoEncodingSubsampGray:
+ subsampling = subsampleGray;
+ break;
+ case pseudoEncodingSubsamp2X:
+ subsampling = subsample2X;
+ break;
+ case pseudoEncodingSubsamp4X:
+ subsampling = subsample4X;
+ break;
+ case pseudoEncodingSubsamp8X:
+ subsampling = subsample8X;
+ break;
+ case pseudoEncodingSubsamp16X:
+ subsampling = subsample16X;
+ break;
+ }
+
+ if (encodings[i] >= pseudoEncodingCompressLevel0 &&
+ encodings[i] <= pseudoEncodingCompressLevel9)
+ compressLevel = encodings[i] - pseudoEncodingCompressLevel0;
+
+ if (encodings[i] >= pseudoEncodingQualityLevel0 &&
+ encodings[i] <= pseudoEncodingQualityLevel9)
+ qualityLevel = encodings[i] - pseudoEncodingQualityLevel0;
+
+ if (encodings[i] >= pseudoEncodingFineQualityLevel0 &&
+ encodings[i] <= pseudoEncodingFineQualityLevel100)
+ fineQualityLevel = encodings[i] - pseudoEncodingFineQualityLevel0;
+
+ if (encodings[i] > 0)
+ encodings_.insert(encodings[i]);
+ }
+}
+
+void ClientParams::setLEDState(unsigned int state)
+{
+ ledState_ = state;
+}
--- /dev/null
+/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright 2014-2018 Pierre Ossman for Cendio AB
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+//
+// ClientParams - structure describing the current state of the remote client
+//
+
+#ifndef __RFB_CLIENTPARAMS_H__
+#define __RFB_CLIENTPARAMS_H__
+
+#include <set>
+
+#include <rdr/types.h>
+#include <rfb/Cursor.h>
+#include <rfb/PixelFormat.h>
+#include <rfb/ScreenSet.h>
+
+namespace rfb {
+
+ const int subsampleUndefined = -1;
+ const int subsampleNone = 0;
+ const int subsampleGray = 1;
+ const int subsample2X = 2;
+ const int subsample4X = 3;
+ const int subsample8X = 4;
+ const int subsample16X = 5;
+
+ class ClientParams {
+ public:
+ ClientParams();
+ ~ClientParams();
+
+ int majorVersion;
+ int minorVersion;
+
+ void setVersion(int major, int minor) {
+ majorVersion = major; minorVersion = minor;
+ }
+ bool isVersion(int major, int minor) const {
+ return majorVersion == major && minorVersion == minor;
+ }
+ bool beforeVersion(int major, int minor) const {
+ return (majorVersion < major ||
+ (majorVersion == major && minorVersion < minor));
+ }
+ bool afterVersion(int major, int minor) const {
+ return !beforeVersion(major,minor+1);
+ }
+
+ const int width() const { return width_; }
+ const int height() const { return height_; }
+ const ScreenSet& screenLayout() const { return screenLayout_; }
+ void setDimensions(int width, int height);
+ void setDimensions(int width, int height, const ScreenSet& layout);
+
+ const PixelFormat& pf() const { return pf_; }
+ void setPF(const PixelFormat& pf);
+
+ const char* name() const { return name_; }
+ void setName(const char* name);
+
+ const Cursor& cursor() const { return *cursor_; }
+ void setCursor(const Cursor& cursor);
+
+ bool supportsEncoding(rdr::S32 encoding) const;
+
+ void setEncodings(int nEncodings, const rdr::S32* encodings);
+
+ unsigned int ledState() { return ledState_; }
+ void setLEDState(unsigned int state);
+
+ bool useCopyRect;
+
+ bool supportsLocalCursor;
+ bool supportsLocalXCursor;
+ bool supportsLocalCursorWithAlpha;
+ bool supportsDesktopResize;
+ bool supportsExtendedDesktopSize;
+ bool supportsDesktopRename;
+ bool supportsLastRect;
+ bool supportsLEDState;
+ bool supportsQEMUKeyEvent;
+
+ bool supportsSetDesktopSize;
+ bool supportsFence;
+ bool supportsContinuousUpdates;
+
+ int compressLevel;
+ int qualityLevel;
+ int fineQualityLevel;
+ int subsampling;
+
+ private:
+
+ int width_;
+ int height_;
+ ScreenSet screenLayout_;
+
+ PixelFormat pf_;
+ char* name_;
+ Cursor* cursor_;
+ std::set<rdr::S32> encodings_;
+ unsigned int ledState_;
+ };
+}
+#endif
+++ /dev/null
-/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
- * Copyright (C) 2011 D. R. Commander. All Rights Reserved.
- * Copyright 2014 Pierre Ossman for Cendio AB
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- */
-#include <stdio.h>
-#include <rfb/Exception.h>
-#include <rfb/encodings.h>
-#include <rfb/ledStates.h>
-#include <rfb/ConnParams.h>
-#include <rfb/util.h>
-
-using namespace rfb;
-
-ConnParams::ConnParams()
- : majorVersion(0), minorVersion(0),
- useCopyRect(false),
- supportsLocalCursor(false), supportsLocalXCursor(false),
- supportsLocalCursorWithAlpha(false),
- supportsDesktopResize(false), supportsExtendedDesktopSize(false),
- supportsDesktopRename(false), supportsLastRect(false),
- supportsLEDState(false), supportsQEMUKeyEvent(false),
- supportsSetDesktopSize(false), supportsFence(false),
- supportsContinuousUpdates(false),
- compressLevel(2), qualityLevel(-1), fineQualityLevel(-1),
- subsampling(subsampleUndefined),
- width_(0), height_(0), name_(0),
- ledState_(ledUnknown)
-{
- setName("");
- cursor_ = new Cursor(0, 0, Point(), NULL);
-}
-
-ConnParams::~ConnParams()
-{
- delete [] name_;
- delete cursor_;
-}
-
-void ConnParams::setDimensions(int width, int height)
-{
- ScreenSet layout;
- layout.add_screen(rfb::Screen(0, 0, 0, width, height, 0));
- setDimensions(width, height, layout);
-}
-
-void ConnParams::setDimensions(int width, int height, const ScreenSet& layout)
-{
- if (!layout.validate(width, height))
- throw Exception("Attempted to configure an invalid screen layout");
-
- width_ = width;
- height_ = height;
- screenLayout_ = layout;
-}
-
-void ConnParams::setPF(const PixelFormat& pf)
-{
- pf_ = pf;
-
- if (pf.bpp != 8 && pf.bpp != 16 && pf.bpp != 32)
- throw Exception("setPF: not 8, 16 or 32 bpp?");
-}
-
-void ConnParams::setName(const char* name)
-{
- delete [] name_;
- name_ = strDup(name);
-}
-
-void ConnParams::setCursor(const Cursor& other)
-{
- delete cursor_;
- cursor_ = new Cursor(other);
-}
-
-bool ConnParams::supportsEncoding(rdr::S32 encoding) const
-{
- return encodings_.count(encoding) != 0;
-}
-
-void ConnParams::setEncodings(int nEncodings, const rdr::S32* encodings)
-{
- useCopyRect = false;
- supportsLocalCursor = false;
- supportsLocalCursorWithAlpha = false;
- supportsDesktopResize = false;
- supportsExtendedDesktopSize = false;
- supportsLocalXCursor = false;
- supportsLastRect = false;
- supportsQEMUKeyEvent = false;
- compressLevel = -1;
- qualityLevel = -1;
- fineQualityLevel = -1;
- subsampling = subsampleUndefined;
-
- encodings_.clear();
- encodings_.insert(encodingRaw);
-
- for (int i = nEncodings-1; i >= 0; i--) {
- switch (encodings[i]) {
- case encodingCopyRect:
- useCopyRect = true;
- break;
- case pseudoEncodingCursor:
- supportsLocalCursor = true;
- break;
- case pseudoEncodingXCursor:
- supportsLocalXCursor = true;
- break;
- case pseudoEncodingCursorWithAlpha:
- supportsLocalCursorWithAlpha = true;
- break;
- case pseudoEncodingDesktopSize:
- supportsDesktopResize = true;
- break;
- case pseudoEncodingExtendedDesktopSize:
- supportsExtendedDesktopSize = true;
- break;
- case pseudoEncodingDesktopName:
- supportsDesktopRename = true;
- break;
- case pseudoEncodingLastRect:
- supportsLastRect = true;
- break;
- case pseudoEncodingLEDState:
- supportsLEDState = true;
- break;
- case pseudoEncodingQEMUKeyEvent:
- supportsQEMUKeyEvent = true;
- break;
- case pseudoEncodingFence:
- supportsFence = true;
- break;
- case pseudoEncodingContinuousUpdates:
- supportsContinuousUpdates = true;
- break;
- case pseudoEncodingSubsamp1X:
- subsampling = subsampleNone;
- break;
- case pseudoEncodingSubsampGray:
- subsampling = subsampleGray;
- break;
- case pseudoEncodingSubsamp2X:
- subsampling = subsample2X;
- break;
- case pseudoEncodingSubsamp4X:
- subsampling = subsample4X;
- break;
- case pseudoEncodingSubsamp8X:
- subsampling = subsample8X;
- break;
- case pseudoEncodingSubsamp16X:
- subsampling = subsample16X;
- break;
- }
-
- if (encodings[i] >= pseudoEncodingCompressLevel0 &&
- encodings[i] <= pseudoEncodingCompressLevel9)
- compressLevel = encodings[i] - pseudoEncodingCompressLevel0;
-
- if (encodings[i] >= pseudoEncodingQualityLevel0 &&
- encodings[i] <= pseudoEncodingQualityLevel9)
- qualityLevel = encodings[i] - pseudoEncodingQualityLevel0;
-
- if (encodings[i] >= pseudoEncodingFineQualityLevel0 &&
- encodings[i] <= pseudoEncodingFineQualityLevel100)
- fineQualityLevel = encodings[i] - pseudoEncodingFineQualityLevel0;
-
- if (encodings[i] > 0)
- encodings_.insert(encodings[i]);
- }
-}
-
-void ConnParams::setLEDState(unsigned int state)
-{
- ledState_ = state;
-}
+++ /dev/null
-/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
- * Copyright 2014 Pierre Ossman for Cendio AB
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- */
-//
-// ConnParams - structure containing the connection parameters.
-//
-
-#ifndef __RFB_CONNPARAMS_H__
-#define __RFB_CONNPARAMS_H__
-
-#include <set>
-
-#include <rdr/types.h>
-#include <rfb/Cursor.h>
-#include <rfb/PixelFormat.h>
-#include <rfb/ScreenSet.h>
-
-namespace rfb {
-
- const int subsampleUndefined = -1;
- const int subsampleNone = 0;
- const int subsampleGray = 1;
- const int subsample2X = 2;
- const int subsample4X = 3;
- const int subsample8X = 4;
- const int subsample16X = 5;
-
- class ConnParams {
- public:
- ConnParams();
- ~ConnParams();
-
- int majorVersion;
- int minorVersion;
-
- void setVersion(int major, int minor) {
- majorVersion = major; minorVersion = minor;
- }
- bool isVersion(int major, int minor) const {
- return majorVersion == major && minorVersion == minor;
- }
- bool beforeVersion(int major, int minor) const {
- return (majorVersion < major ||
- (majorVersion == major && minorVersion < minor));
- }
- bool afterVersion(int major, int minor) const {
- return !beforeVersion(major,minor+1);
- }
-
- const int width() const { return width_; }
- const int height() const { return height_; }
- const ScreenSet& screenLayout() const { return screenLayout_; }
- void setDimensions(int width, int height);
- void setDimensions(int width, int height, const ScreenSet& layout);
-
- const PixelFormat& pf() const { return pf_; }
- void setPF(const PixelFormat& pf);
-
- const char* name() const { return name_; }
- void setName(const char* name);
-
- const Cursor& cursor() const { return *cursor_; }
- void setCursor(const Cursor& cursor);
-
- bool supportsEncoding(rdr::S32 encoding) const;
-
- void setEncodings(int nEncodings, const rdr::S32* encodings);
-
- unsigned int ledState() { return ledState_; }
- void setLEDState(unsigned int state);
-
- bool useCopyRect;
-
- bool supportsLocalCursor;
- bool supportsLocalXCursor;
- bool supportsLocalCursorWithAlpha;
- bool supportsDesktopResize;
- bool supportsExtendedDesktopSize;
- bool supportsDesktopRename;
- bool supportsLastRect;
- bool supportsLEDState;
- bool supportsQEMUKeyEvent;
-
- bool supportsSetDesktopSize;
- bool supportsFence;
- bool supportsContinuousUpdates;
-
- int compressLevel;
- int qualityLevel;
- int fineQualityLevel;
- int subsampling;
-
- private:
-
- int width_;
- int height_;
- ScreenSet screenLayout_;
-
- PixelFormat pf_;
- char* name_;
- Cursor* cursor_;
- std::set<rdr::S32> encodings_;
- unsigned int ledState_;
- };
-}
-#endif
changed.assign_subtract(renderedCursor->getEffectiveRect());
}
- if (conn->cp.supportsLastRect)
+ if (conn->client.supportsLastRect)
nRects = 0xFFFF;
else {
nRects = copied.numRects();
* We start by searching for solid rects, which are then removed
* from the changed region.
*/
- if (conn->cp.supportsLastRect)
+ if (conn->client.supportsLastRect)
writeSolidRects(&changed, pb);
writeRects(changed, pb);
solid = bitmap = bitmapRLE = encoderRaw;
indexed = indexedRLE = fullColour = encoderRaw;
- allowJPEG = conn->cp.pf().bpp >= 16;
+ allowJPEG = conn->client.pf().bpp >= 16;
if (!allowLossy) {
if (encoders[encoderTightJPEG]->losslessQuality == -1)
allowJPEG = false;
}
// JPEG is the only encoder that can reduce things to grayscale
- if ((conn->cp.subsampling == subsampleGray) &&
+ if ((conn->client.subsampling == subsampleGray) &&
encoders[encoderTightJPEG]->isSupported() && allowLossy) {
solid = bitmap = bitmapRLE = encoderTightJPEG;
indexed = indexedRLE = fullColour = encoderTightJPEG;
encoder = encoders[*iter];
- encoder->setCompressLevel(conn->cp.compressLevel);
+ encoder->setCompressLevel(conn->client.compressLevel);
if (allowLossy) {
- encoder->setQualityLevel(conn->cp.qualityLevel);
- encoder->setFineQualityLevel(conn->cp.fineQualityLevel,
- conn->cp.subsampling);
+ encoder->setQualityLevel(conn->client.qualityLevel);
+ encoder->setFineQualityLevel(conn->client.fineQualityLevel,
+ conn->client.subsampling);
} else {
- int level = __rfbmax(conn->cp.qualityLevel,
+ int level = __rfbmax(conn->client.qualityLevel,
encoder->losslessQuality);
encoder->setQualityLevel(level);
encoder->setFineQualityLevel(-1, subsampleUndefined);
stats[klass][activeType].rects++;
stats[klass][activeType].pixels += rect.area();
- equiv = 12 + rect.area() * (conn->cp.pf().bpp/8);
+ equiv = 12 + rect.area() * (conn->client.pf().bpp/8);
stats[klass][activeType].equivalent += equiv;
encoder = encoders[klass];
copyStats.rects++;
copyStats.pixels += rect->area();
- equiv = 12 + rect->area() * (conn->cp.pf().bpp/8);
+ equiv = 12 + rect->area() * (conn->client.pf().bpp/8);
copyStats.equivalent += equiv;
conn->writer()->writeCopyRect(*rect, rect->tl.x - delta.x,
rdr::U32 _buffer2;
rdr::U8* converted = (rdr::U8*)&_buffer2;
- conn->cp.pf().bufferFromBuffer(converted, pb->getPF(),
+ conn->client.pf().bufferFromBuffer(converted, pb->getPF(),
colourValue, 1);
encoder->writeSolidRect(erp.width(), erp.height(),
- conn->cp.pf(), converted);
+ conn->client.pf(), converted);
}
endRect();
// compression setting means spending less effort in building
// a palette. It might be that they figured the increase in
// zlib setting compensated for the loss.
- if (conn->cp.compressLevel == -1)
+ if (conn->client.compressLevel == -1)
divisor = 2 * 8;
else
- divisor = conn->cp.compressLevel * 8;
+ divisor = conn->client.compressLevel * 8;
if (divisor < 4)
divisor = 4;
// Special exception inherited from the Tight encoder
if (activeEncoders[encoderFullColour] == encoderTightJPEG) {
- if ((conn->cp.compressLevel != -1) && (conn->cp.compressLevel < 2))
+ if ((conn->client.compressLevel != -1) && (conn->client.compressLevel < 2))
maxColours = 24;
else
maxColours = 96;
int stride;
// Do wo need to convert the data?
- if (convert && !conn->cp.pf().equal(pb->getPF())) {
- convertedPixelBuffer.setPF(conn->cp.pf());
+ if (convert && !conn->client.pf().equal(pb->getPF())) {
+ convertedPixelBuffer.setPF(conn->client.pf());
convertedPixelBuffer.setSize(rect.width(), rect.height());
buffer = pb->getBuffer(rect, &stride);
bool HextileEncoder::isSupported()
{
- return conn->cp.supportsEncoding(encodingHextile);
+ return conn->client.supportsEncoding(encodingHextile);
}
void HextileEncoder::writeRect(const PixelBuffer* pb, const Palette& palette)
#include <rdr/Exception.h>
#include <rfb/Rect.h>
#include <rfb/PixelFormat.h>
-#include <rfb/ConnParams.h>
+#include <rfb/ClientParams.h>
#include <stdio.h>
extern "C" {
bool RREEncoder::isSupported()
{
- return conn->cp.supportsEncoding(encodingRRE);
+ return conn->client.supportsEncoding(encodingRRE);
}
void RREEncoder::writeRect(const PixelBuffer* pb, const Palette& palette)
if (rfb::Server::protocol3_3)
defaultMinorVersion = 3;
- cp.setVersion(defaultMajorVersion, defaultMinorVersion);
+ client.setVersion(defaultMajorVersion, defaultMinorVersion);
}
SConnection::~SConnection()
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();
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.
}
if (i == secTypes.end()) {
throwConnFailedException("No supported security type for %d.%d client",
- cp.majorVersion, cp.minorVersion);
+ client.majorVersion, client.minorVersion);
}
os->writeU32(*i);
} 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;
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();
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
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;
{
if (!readyForSetColourMapEntries) {
readyForSetColourMapEntries = true;
- if (!cp.pf().trueColour) {
+ if (!client.pf().trueColour) {
writeFakeColourMap();
}
}
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);
}
void SMsgHandler::setPixelFormat(const PixelFormat& pf)
{
- cp.setPF(pf);
+ client.setPF(pf);
}
void SMsgHandler::setEncodings(int nEncodings, const rdr::S32* encodings)
bool firstFence, firstContinuousUpdates, firstLEDState,
firstQEMUKeyEvent;
- firstFence = !cp.supportsFence;
- firstContinuousUpdates = !cp.supportsContinuousUpdates;
- firstLEDState = !cp.supportsLEDState;
- firstQEMUKeyEvent = !cp.supportsQEMUKeyEvent;
+ firstFence = !client.supportsFence;
+ firstContinuousUpdates = !client.supportsContinuousUpdates;
+ firstLEDState = !client.supportsLEDState;
+ firstQEMUKeyEvent = !client.supportsQEMUKeyEvent;
- cp.setEncodings(nEncodings, encodings);
+ client.setEncodings(nEncodings, encodings);
supportsLocalCursor();
- if (cp.supportsFence && firstFence)
+ if (client.supportsFence && firstFence)
supportsFence();
- if (cp.supportsContinuousUpdates && firstContinuousUpdates)
+ if (client.supportsContinuousUpdates && firstContinuousUpdates)
supportsContinuousUpdates();
- if (cp.supportsLEDState && firstLEDState)
+ if (client.supportsLEDState && firstLEDState)
supportsLEDState();
- if (cp.supportsQEMUKeyEvent && firstQEMUKeyEvent)
+ if (client.supportsQEMUKeyEvent && firstQEMUKeyEvent)
supportsQEMUKeyEvent();
}
void SMsgHandler::setDesktopSize(int fb_width, int fb_height,
const ScreenSet& layout)
{
- cp.setDimensions(fb_width, fb_height, layout);
+ client.setDimensions(fb_width, fb_height, layout);
}
#include <rdr/types.h>
#include <rfb/PixelFormat.h>
-#include <rfb/ConnParams.h>
+#include <rfb/ClientParams.h>
#include <rfb/InputHandler.h>
#include <rfb/ScreenSet.h>
// handler will send a pseudo-rect back, signalling server support.
virtual void supportsQEMUKeyEvent();
- ConnParams cp;
+ ClientParams client;
};
}
#endif
#include <rfb/msgTypes.h>
#include <rfb/fenceTypes.h>
#include <rfb/Exception.h>
-#include <rfb/ConnParams.h>
+#include <rfb/ClientParams.h>
#include <rfb/UpdateTracker.h>
#include <rfb/Encoder.h>
#include <rfb/SMsgWriter.h>
static LogWriter vlog("SMsgWriter");
-SMsgWriter::SMsgWriter(ConnParams* cp_, rdr::OutStream* os_)
- : cp(cp_), os(os_),
+SMsgWriter::SMsgWriter(ClientParams* client_, rdr::OutStream* os_)
+ : client(client_), os(os_),
nRectsInUpdate(0), nRectsInHeader(0),
needSetDesktopSize(false), needExtendedDesktopSize(false),
needSetDesktopName(false), needSetCursor(false),
void SMsgWriter::writeServerInit()
{
- os->writeU16(cp->width());
- os->writeU16(cp->height());
- cp->pf().write(os);
- os->writeString(cp->name());
+ os->writeU16(client->width());
+ os->writeU16(client->height());
+ client->pf().write(os);
+ os->writeString(client->name());
endMsg();
}
void SMsgWriter::writeFence(rdr::U32 flags, unsigned len, const char data[])
{
- if (!cp->supportsFence)
+ if (!client->supportsFence)
throw Exception("Client does not support fences");
if (len > 64)
throw Exception("Too large fence payload");
void SMsgWriter::writeEndOfContinuousUpdates()
{
- if (!cp->supportsContinuousUpdates)
+ if (!client->supportsContinuousUpdates)
throw Exception("Client does not support continuous updates");
startMsg(msgTypeEndOfContinuousUpdates);
}
bool SMsgWriter::writeSetDesktopSize() {
- if (!cp->supportsDesktopResize)
+ if (!client->supportsDesktopResize)
return false;
needSetDesktopSize = true;
}
bool SMsgWriter::writeExtendedDesktopSize() {
- if (!cp->supportsExtendedDesktopSize)
+ if (!client->supportsExtendedDesktopSize)
return false;
needExtendedDesktopSize = true;
const ScreenSet& layout) {
ExtendedDesktopSizeMsg msg;
- if (!cp->supportsExtendedDesktopSize)
+ if (!client->supportsExtendedDesktopSize)
return false;
msg.reason = reason;
}
bool SMsgWriter::writeSetDesktopName() {
- if (!cp->supportsDesktopRename)
+ if (!client->supportsDesktopRename)
return false;
needSetDesktopName = true;
bool SMsgWriter::writeSetCursor()
{
- if (!cp->supportsLocalCursor)
+ if (!client->supportsLocalCursor)
return false;
needSetCursor = true;
bool SMsgWriter::writeSetXCursor()
{
- if (!cp->supportsLocalXCursor)
+ if (!client->supportsLocalXCursor)
return false;
needSetXCursor = true;
bool SMsgWriter::writeSetCursorWithAlpha()
{
- if (!cp->supportsLocalCursorWithAlpha)
+ if (!client->supportsLocalCursorWithAlpha)
return false;
needSetCursorWithAlpha = true;
bool SMsgWriter::writeLEDState()
{
- if (!cp->supportsLEDState)
+ if (!client->supportsLEDState)
return false;
- if (cp->ledState() == ledUnknown)
+ if (client->ledState() == ledUnknown)
return false;
needLEDState = true;
bool SMsgWriter::writeQEMUKeyEvent()
{
- if (!cp->supportsQEMUKeyEvent)
+ if (!client->supportsQEMUKeyEvent)
return false;
needQEMUKeyEvent = true;
void SMsgWriter::writePseudoRects()
{
if (needSetCursor) {
- const Cursor& cursor = cp->cursor();
+ const Cursor& cursor = client->cursor();
- rdr::U8Array data(cursor.width()*cursor.height() * (cp->pf().bpp/8));
+ rdr::U8Array data(cursor.width()*cursor.height() * (client->pf().bpp/8));
rdr::U8Array mask(cursor.getMask());
const rdr::U8* in;
in = cursor.getBuffer();
out = data.buf;
for (int i = 0;i < cursor.width()*cursor.height();i++) {
- cp->pf().bufferFromRGB(out, in, 1);
+ client->pf().bufferFromRGB(out, in, 1);
in += 4;
- out += cp->pf().bpp/8;
+ out += client->pf().bpp/8;
}
writeSetCursorRect(cursor.width(), cursor.height(),
}
if (needSetXCursor) {
- const Cursor& cursor = cp->cursor();
+ const Cursor& cursor = client->cursor();
rdr::U8Array bitmap(cursor.getBitmap());
rdr::U8Array mask(cursor.getMask());
}
if (needSetCursorWithAlpha) {
- const Cursor& cursor = cp->cursor();
+ const Cursor& cursor = client->cursor();
writeSetCursorWithAlphaRect(cursor.width(), cursor.height(),
cursor.hotspot().x, cursor.hotspot().y,
}
if (needSetDesktopName) {
- writeSetDesktopNameRect(cp->name());
+ writeSetDesktopNameRect(client->name());
needSetDesktopName = false;
}
if (needLEDState) {
- writeLEDStateRect(cp->ledState());
+ writeLEDStateRect(client->ledState());
needLEDState = false;
}
// Send this before SetDesktopSize to make life easier on the clients
if (needExtendedDesktopSize) {
- writeExtendedDesktopSizeRect(0, 0, cp->width(), cp->height(),
- cp->screenLayout());
+ writeExtendedDesktopSizeRect(0, 0, client->width(), client->height(),
+ client->screenLayout());
needExtendedDesktopSize = false;
}
// Some clients assume this is the last rectangle so don't send anything
// more after this
if (needSetDesktopSize) {
- writeSetDesktopSizeRect(cp->width(), cp->height());
+ writeSetDesktopSizeRect(client->width(), client->height());
needSetDesktopSize = false;
}
}
void SMsgWriter::writeSetDesktopSizeRect(int width, int height)
{
- if (!cp->supportsDesktopResize)
+ if (!client->supportsDesktopResize)
throw Exception("Client does not support desktop resize");
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
throw Exception("SMsgWriter::writeSetDesktopSizeRect: nRects out of sync");
{
ScreenSet::const_iterator si;
- if (!cp->supportsExtendedDesktopSize)
+ if (!client->supportsExtendedDesktopSize)
throw Exception("Client does not support extended desktop resize");
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
throw Exception("SMsgWriter::writeExtendedDesktopSizeRect: nRects out of sync");
void SMsgWriter::writeSetDesktopNameRect(const char *name)
{
- if (!cp->supportsDesktopRename)
+ if (!client->supportsDesktopRename)
throw Exception("Client does not support desktop rename");
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
throw Exception("SMsgWriter::writeSetDesktopNameRect: nRects out of sync");
int hotspotX, int hotspotY,
const void* data, const void* mask)
{
- if (!cp->supportsLocalCursor)
+ if (!client->supportsLocalCursor)
throw Exception("Client does not support local cursors");
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
throw Exception("SMsgWriter::writeSetCursorRect: nRects out of sync");
os->writeU16(width);
os->writeU16(height);
os->writeU32(pseudoEncodingCursor);
- os->writeBytes(data, width * height * (cp->pf().bpp/8));
+ os->writeBytes(data, width * height * (client->pf().bpp/8));
os->writeBytes(mask, (width+7)/8 * height);
}
int hotspotX, int hotspotY,
const void* data, const void* mask)
{
- if (!cp->supportsLocalXCursor)
+ if (!client->supportsLocalXCursor)
throw Exception("Client does not support local cursors");
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
throw Exception("SMsgWriter::writeSetXCursorRect: nRects out of sync");
int hotspotX, int hotspotY,
const rdr::U8* data)
{
- if (!cp->supportsLocalCursorWithAlpha)
+ if (!client->supportsLocalCursorWithAlpha)
throw Exception("Client does not support local cursors");
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
throw Exception("SMsgWriter::writeSetCursorWithAlphaRect: nRects out of sync");
void SMsgWriter::writeLEDStateRect(rdr::U8 state)
{
- if (!cp->supportsLEDState)
+ if (!client->supportsLEDState)
throw Exception("Client does not support LED state updates");
- if (cp->ledState() == ledUnknown)
+ if (client->ledState() == ledUnknown)
throw Exception("Server does not support LED state updates");
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
throw Exception("SMsgWriter::writeLEDStateRect: nRects out of sync");
void SMsgWriter::writeQEMUKeyEventRect()
{
- if (!cp->supportsQEMUKeyEvent)
+ if (!client->supportsQEMUKeyEvent)
throw Exception("Client does not support QEMU extended key events");
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
throw Exception("SMsgWriter::writeQEMUKeyEventRect: nRects out of sync");
namespace rfb {
- class ConnParams;
+ class ClientParams;
struct ScreenSet;
class SMsgWriter {
public:
- SMsgWriter(ConnParams* cp, rdr::OutStream* os);
+ SMsgWriter(ClientParams* client, rdr::OutStream* os);
virtual ~SMsgWriter();
// writeServerInit() must only be called at the appropriate time in the
void writeLEDStateRect(rdr::U8 state);
void writeQEMUKeyEventRect();
- ConnParams* cp;
+ ClientParams* client;
rdr::OutStream* os;
int nRectsInUpdate;
#include <rfb/PixelBuffer.h>
#include <rfb/Palette.h>
#include <rfb/encodings.h>
-#include <rfb/ConnParams.h>
#include <rfb/SConnection.h>
#include <rfb/TightEncoder.h>
#include <rfb/TightConstants.h>
bool TightEncoder::isSupported()
{
- return conn->cp.supportsEncoding(encodingTight);
+ return conn->client.supportsEncoding(encodingTight);
}
void TightEncoder::setCompressLevel(int level)
bool TightJPEGEncoder::isSupported()
{
- if (!conn->cp.supportsEncoding(encodingTight))
+ if (!conn->client.supportsEncoding(encodingTight))
return false;
// Any one of these indicates support for JPEG
- if (conn->cp.qualityLevel != -1)
+ if (conn->client.qualityLevel != -1)
return true;
- if (conn->cp.fineQualityLevel != -1)
+ if (conn->client.fineQualityLevel != -1)
return true;
- if (conn->cp.subsampling != -1)
+ if (conn->client.subsampling != -1)
return true;
// Tight support, but not JPEG
{
try {
if (!authenticated()) return;
- if (cp.width() && cp.height() &&
- (server->pb->width() != cp.width() ||
- server->pb->height() != cp.height()))
+ if (client.width() && client.height() &&
+ (server->pb->width() != client.width() ||
+ server->pb->height() != client.height()))
{
// We need to clip the next update to the new size, but also add any
// extra bits if it's bigger. If we wanted to do this exactly, something
//updates.intersect(server->pb->getRect());
//
- //if (server->pb->width() > cp.width())
- // updates.add_changed(Rect(cp.width(), 0, server->pb->width(),
+ //if (server->pb->width() > client.width())
+ // updates.add_changed(Rect(client.width(), 0, server->pb->width(),
// server->pb->height()));
- //if (server->pb->height() > cp.height())
- // updates.add_changed(Rect(0, cp.height(), client.width(),
+ //if (server->pb->height() > client.height())
+ // updates.add_changed(Rect(0, client.height(), client.width(),
// server->pb->height()));
damagedCursorRegion.assign_intersect(server->pb->getRect());
- cp.setDimensions(server->pb->width(), server->pb->height(),
- server->screenLayout);
+ client.setDimensions(server->pb->width(), server->pb->height(),
+ server->screenLayout);
if (state() == RFBSTATE_NORMAL) {
// We should only send EDS to client asking for both
if (!writer()->writeExtendedDesktopSize()) {
// We interpret a low compression level as an indication that the client
// wants to prioritise CPU usage over bandwidth, and hence disable the
// comparing update tracker.
- return (cp.compressLevel == -1) || (cp.compressLevel > 1);
+ return (client.compressLevel == -1) || (client.compressLevel > 1);
}
if (state() != RFBSTATE_NORMAL)
return false;
- if (!cp.supportsLocalCursorWithAlpha &&
- !cp.supportsLocalCursor && !cp.supportsLocalXCursor)
+ if (!client.supportsLocalCursorWithAlpha &&
+ !client.supportsLocalCursor && !client.supportsLocalXCursor)
return true;
if (!server->cursorPos.equals(pointerEventPos) &&
(time(0) - pointerEventTime) > 0)
server->startDesktop();
// - Set the connection parameters appropriately
- cp.setDimensions(server->pb->width(), server->pb->height(),
- server->screenLayout);
- cp.setName(server->getName());
- cp.setLEDState(server->ledState);
+ client.setDimensions(server->pb->width(), server->pb->height(),
+ server->screenLayout);
+ client.setName(server->getName());
+ client.setLEDState(server->ledState);
// - Set the default pixel format
- cp.setPF(server->pb->getPF());
+ client.setPF(server->pb->getPF());
char buffer[256];
- cp.pf().print(buffer, 256);
+ client.pf().print(buffer, 256);
vlog.info("Server default pixel format %s", buffer);
// - Mark the entire display as "dirty"
// Lock key heuristics
// (only for clients that do not support the LED state extension)
- if (!cp.supportsLEDState) {
+ if (!client.supportsLEDState) {
// Always ignore ScrollLock as we don't have a heuristic
// for that
if (keysym == XK_Scroll_Lock) {
SConnection::framebufferUpdateRequest(r, incremental);
// Check that the client isn't sending crappy requests
- if (!r.enclosed_by(Rect(0, 0, cp.width(), cp.height()))) {
+ if (!r.enclosed_by(Rect(0, 0, client.width(), client.height()))) {
vlog.error("FramebufferUpdateRequest %dx%d at %d,%d exceeds framebuffer %dx%d",
r.width(), r.height(), r.tl.x, r.tl.y,
- cp.width(), cp.height());
- safeRect = r.intersect(Rect(0, 0, cp.width(), cp.height()));
+ client.width(), client.height());
+ safeRect = r.intersect(Rect(0, 0, client.width(), client.height()));
} else {
safeRect = r;
}
{
Rect rect;
- if (!cp.supportsFence || !cp.supportsContinuousUpdates)
+ if (!client.supportsFence || !client.supportsContinuousUpdates)
throw Exception("Client tried to enable continuous updates when not allowed");
continuousUpdates = enable;
}
// supportsLocalCursor() is called whenever the status of
-// cp.supportsLocalCursor has changed. If the client does now support local
+// client.supportsLocalCursor has changed. If the client does now support local
// cursor, we make sure that the old server-side rendered cursor is cleaned up
// and the cursor is sent to the client.
{
// We refuse to use continuous updates if we cannot monitor the buffer
// usage using fences.
- if (!cp.supportsFence)
+ if (!client.supportsFence)
return;
writer()->writeEndOfContinuousUpdates();
{
char type;
- if (!cp.supportsFence)
+ if (!client.supportsFence)
return;
congestion.updatePosition(sock->outStream().length());
if (sock->outStream().bufferUsage() > 0)
return true;
- if (!cp.supportsFence)
+ if (!client.supportsFence)
return false;
congestion.updatePosition(sock->outStream().length());
bool needNewUpdateInfo;
const RenderedCursor *cursor;
- updates.enable_copyrect(cp.useCopyRect);
+ updates.enable_copyrect(client.useCopyRect);
// See what the client has requested (if anything)
if (continuousUpdates)
if (!authenticated())
return;
- cp.setDimensions(cp.width(), cp.height(),
- server->screenLayout);
+ client.setDimensions(client.width(), client.height(),
+ server->screenLayout);
if (state() != RFBSTATE_NORMAL)
return;
writer()->writeExtendedDesktopSize(reason, 0,
- cp.width(), cp.height(),
- cp.screenLayout());
+ client.width(), client.height(),
+ client.screenLayout());
}
// We need to blank out the client's cursor or there will be two
if (needRenderedCursor()) {
- cp.setCursor(emptyCursor);
+ client.setCursor(emptyCursor);
clientHasCursor = false;
} else {
- cp.setCursor(*server->cursor);
+ client.setCursor(*server->cursor);
clientHasCursor = true;
}
void VNCSConnectionST::setDesktopName(const char *name)
{
- cp.setName(name);
+ client.setName(name);
if (state() != RFBSTATE_NORMAL)
return;
if (state() != RFBSTATE_NORMAL)
return;
- cp.setLEDState(ledstate);
+ client.setLEDState(ledstate);
writer()->writeLEDState();
}
#include <rdr/OutStream.h>
#include <rfb/Exception.h>
#include <rfb/encodings.h>
-#include <rfb/ConnParams.h>
#include <rfb/Palette.h>
#include <rfb/SConnection.h>
#include <rfb/ZRLEEncoder.h>
bool ZRLEEncoder::isSupported()
{
- return conn->cp.supportsEncoding(encodingZRLE);
+ return conn->client.supportsEncoding(encodingZRLE);
}
void ZRLEEncoder::writeRect(const PixelBuffer* pb, const Palette& palette)
setDesktopSize(width, height);
sc = new SConn();
- sc->cp.setPF((bool)translate ? fbPF : pf);
+ sc->client.setPF((bool)translate ? fbPF : pf);
sc->setEncodings(sizeof(encodings) / sizeof(*encodings), encodings);
}
out = new DummyOutStream;
setStreams(NULL, out);
- setWriter(new rfb::SMsgWriter(&cp, out));
+ setWriter(new rfb::SMsgWriter(&client, out));
manager = new Manager(this);
}