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/TightDecoder.cxx b/common/rfb/TightDecoder.cxx
index a317d25..bfc3352 100644
--- a/common/rfb/TightDecoder.cxx
+++ b/common/rfb/TightDecoder.cxx
@@ -18,6 +18,7 @@
* USA.
*/
#include <rfb/CMsgReader.h>
+#include <rfb/CConnection.h>
#include <rfb/CMsgHandler.h>
#include <rfb/TightDecoder.h>
@@ -35,7 +36,7 @@
#include <rfb/tightDecode.h>
#undef BPP
-TightDecoder::TightDecoder(CMsgReader* reader) : Decoder(reader)
+TightDecoder::TightDecoder(CConnection* conn) : Decoder(conn)
{
}
@@ -45,7 +46,7 @@
void TightDecoder::readRect(const Rect& r, CMsgHandler* handler)
{
- is = reader->getInStream();
+ is = conn->getInStream();
this->handler = handler;
clientpf = handler->getPreferredPF();
serverpf = handler->cp.pf();