Move version reading/writing out of ConnParams
That object is just a container for the current state. Move the I/O
to the classes already doing such stuff.
diff --git a/common/rfb/ConnParams.cxx b/common/rfb/ConnParams.cxx
index 80b4a5a..405a99c 100644
--- a/common/rfb/ConnParams.cxx
+++ b/common/rfb/ConnParams.cxx
@@ -18,8 +18,6 @@
* USA.
*/
#include <stdio.h>
-#include <rdr/InStream.h>
-#include <rdr/OutStream.h>
#include <rfb/Exception.h>
#include <rfb/encodings.h>
#include <rfb/ledStates.h>
@@ -39,7 +37,7 @@
supportsSetDesktopSize(false), supportsFence(false),
supportsContinuousUpdates(false),
compressLevel(2), qualityLevel(-1), fineQualityLevel(-1),
- subsampling(subsampleUndefined), name_(0), verStrPos(0),
+ subsampling(subsampleUndefined), name_(0),
ledState_(ledUnknown)
{
setName("");
@@ -52,30 +50,6 @@
delete cursor_;
}
-bool ConnParams::readVersion(rdr::InStream* is, bool* done)
-{
- if (verStrPos >= 12) return false;
- while (is->checkNoWait(1) && verStrPos < 12) {
- verStr[verStrPos++] = is->readU8();
- }
-
- if (verStrPos < 12) {
- *done = false;
- return true;
- }
- *done = true;
- verStr[12] = 0;
- return (sscanf(verStr, "RFB %03d.%03d\n", &majorVersion,&minorVersion) == 2);
-}
-
-void ConnParams::writeVersion(rdr::OutStream* os)
-{
- char str[13];
- sprintf(str, "RFB %03d.%03d\n", majorVersion, minorVersion);
- os->writeBytes(str, 12);
- os->flush();
-}
-
void ConnParams::setPF(const PixelFormat& pf)
{
pf_ = pf;