Encoders/decoders should track the connection object
The connection object is a much more appropriate object for the
decoders and encoders to keep track of. Besides the streams, it also
contains state like connection parameters.
diff --git a/common/rfb/SMsgWriter.cxx b/common/rfb/SMsgWriter.cxx
index 67590fe..40e6d7f 100644
--- a/common/rfb/SMsgWriter.cxx
+++ b/common/rfb/SMsgWriter.cxx
@@ -320,7 +320,7 @@
currentEncoding = encoding;
lenBeforeRect = os->length();
if (encoding != encodingCopyRect)
- rawBytesEquivalent += 12 + r.width() * r.height() * (bpp()/8);
+ rawBytesEquivalent += 12 + r.width() * r.height() * (cp->pf().bpp/8);
os->writeS16(r.tl.x);
os->writeS16(r.tl.y);
@@ -357,11 +357,6 @@
return imageBuf;
}
-int SMsgWriter::bpp()
-{
- return cp->pf().bpp;
-}
-
void SMsgWriter::startMsg(int type)
{
os->writeU8(type);