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/CopyRectDecoder.cxx b/common/rfb/CopyRectDecoder.cxx
index 4c83583..bb3084f 100644
--- a/common/rfb/CopyRectDecoder.cxx
+++ b/common/rfb/CopyRectDecoder.cxx
@@ -16,14 +16,14 @@
* USA.
*/
#include <rdr/InStream.h>
-#include <rfb/CMsgReader.h>
+#include <rfb/CConnection.h>
#include <rfb/CMsgHandler.h>
#include <rfb/PixelBuffer.h>
#include <rfb/CopyRectDecoder.h>
using namespace rfb;
-CopyRectDecoder::CopyRectDecoder(CMsgReader* reader) : Decoder(reader)
+CopyRectDecoder::CopyRectDecoder(CConnection* conn) : Decoder(conn)
{
}
@@ -33,7 +33,7 @@
void CopyRectDecoder::readRect(const Rect& r, CMsgHandler* handler)
{
- int srcX = reader->getInStream()->readU16();
- int srcY = reader->getInStream()->readU16();
+ int srcX = conn->getInStream()->readU16();
+ int srcY = conn->getInStream()->readU16();
handler->copyRect(r, srcX, srcY);
}