aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/Control.cpp
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-04-19 10:47:43 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-04-19 10:47:43 +0200
commit03b65211260ff757b35a367f8936fd5e882ce56c (patch)
tree014155ca365a93687f99ea6492dd2c9d3e80593e /nxcomp/Control.cpp
parent2ffe52c5ecb7cf6af111c685eee7f8fcfd1139a9 (diff)
parent5c495241069708e9b1bbf6e57fd49599be540b63 (diff)
downloadnx-libs-03b65211260ff757b35a367f8936fd5e882ce56c.tar.gz
nx-libs-03b65211260ff757b35a367f8936fd5e882ce56c.tar.bz2
nx-libs-03b65211260ff757b35a367f8936fd5e882ce56c.zip
Merge branch 'fcarvajaldev-3.6.x-remove-old-proto-compat' into 3.6.x
Diffstat (limited to 'nxcomp/Control.cpp')
-rw-r--r--nxcomp/Control.cpp107
1 files changed, 23 insertions, 84 deletions
diff --git a/nxcomp/Control.cpp b/nxcomp/Control.cpp
index 062654235..1bf2dbdd2 100644
--- a/nxcomp/Control.cpp
+++ b/nxcomp/Control.cpp
@@ -349,6 +349,14 @@
#define FILE_SIZE_CHECK_TIMEOUT 60000
//
+// Protocol version compatibility values
+//
+
+const int Control::NX_MIN_PROTO_STEP = 10;
+const int Control::NX_MAX_PROTO_STEP = 10;
+const char* const Control::NXPROXY_COMPATIBILITY_VERSION = "3.5.0";
+
+//
// Set defaults for control. They should be what
// you get in case of 'local' connection.
//
@@ -633,11 +641,7 @@ Control::Control()
// time the session is negotiated.
//
- protoStep6_ = 0;
- protoStep7_ = 0;
- protoStep8_ = 0;
- protoStep9_ = 0;
- protoStep10_ = 0;
+ protoStep_ = 0;
}
Control::~Control()
@@ -705,92 +709,27 @@ Control::~Control()
void Control::setProtoStep(int step)
{
- switch (step)
+ if (isValidProtoStep(step))
{
- case 6:
- {
- protoStep6_ = 1;
- protoStep7_ = 0;
- protoStep8_ = 0;
- protoStep9_ = 0;
- protoStep10_ = 0;
-
- break;
- }
- case 7:
- {
- protoStep6_ = 1;
- protoStep7_ = 1;
- protoStep8_ = 0;
- protoStep9_ = 0;
- protoStep10_ = 0;
-
- break;
- }
- case 8:
- {
- protoStep6_ = 1;
- protoStep7_ = 1;
- protoStep8_ = 1;
- protoStep9_ = 0;
- protoStep10_ = 0;
-
- break;
- }
- case 9:
- {
- protoStep6_ = 1;
- protoStep7_ = 1;
- protoStep8_ = 1;
- protoStep9_ = 1;
- protoStep10_ = 0;
-
- break;
- }
- case 10:
- {
- protoStep6_ = 1;
- protoStep7_ = 1;
- protoStep8_ = 1;
- protoStep9_ = 1;
- protoStep10_ = 1;
-
- break;
- }
- default:
- {
- #ifdef PANIC
- *logofs << "Control: PANIC! Invalid protocol step "
- << "with value " << step << ".\n"
- << logofs_flush;
- #endif
-
- HandleCleanup();
- }
+ protoStep_ = step;
+ }
+ else
+ {
+ #ifdef PANIC
+ *logofs << "Control: PANIC! Invalid protocol step "
+ << "with value " << step << ".\n"
+ << logofs_flush;
+ #endif
+
+ HandleCleanup();
}
}
int Control::getProtoStep()
{
- if (protoStep10_ == 1)
- {
- return 10;
- }
- else if (protoStep9_ == 1)
- {
- return 9;
- }
- else if (protoStep8_ == 1)
- {
- return 8;
- }
- else if (protoStep7_ == 1)
- {
- return 7;
- }
- else if (protoStep6_ == 1)
+ if (isValidProtoStep(protoStep_))
{
- return 6;
+ return protoStep_;
}
else
{