diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-10-10 15:17:40 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-10-10 15:17:40 +0200 |
commit | 13041f5c0dea4a81bce06b912db617dfd8ebed34 (patch) | |
tree | 146fcc00287144aa47ed27a5e8d4aa7f4be64588 | |
parent | 17ae45e0fd5a5574d5175657d8ce901ce79f2379 (diff) | |
parent | f2c73bd845c2f07c4194f438ef4ce8bbe249bf40 (diff) | |
download | nx-libs-13041f5c0dea4a81bce06b912db617dfd8ebed34.tar.gz nx-libs-13041f5c0dea4a81bce06b912db617dfd8ebed34.tar.bz2 nx-libs-13041f5c0dea4a81bce06b912db617dfd8ebed34.zip |
Merge branch 'theqvd-media_argument_bugfix' into 3.6.x
Attributes GH PR #526: https://github.com/ArcticaProject/nx-libs/pull/526
-rw-r--r-- | nxcomp/src/ChannelEndPoint.cpp | 5 | ||||
-rw-r--r-- | nxcomp/src/ChannelEndPoint.h | 1 | ||||
-rw-r--r-- | nxcomp/src/Loop.cpp | 24 |
3 files changed, 19 insertions, 11 deletions
diff --git a/nxcomp/src/ChannelEndPoint.cpp b/nxcomp/src/ChannelEndPoint.cpp index 78902399c..4fdf0fad4 100644 --- a/nxcomp/src/ChannelEndPoint.cpp +++ b/nxcomp/src/ChannelEndPoint.cpp @@ -312,6 +312,11 @@ ChannelEndPoint::enabled() const { } bool +ChannelEndPoint::configured() const { + return ( spec_ && ( strcmp(spec_, "0") != 0) ); +} + +bool ChannelEndPoint::validateSpec() { isTCP_ = getTCPHostAndPort(); isUnix_ = getUnixPath(); diff --git a/nxcomp/src/ChannelEndPoint.h b/nxcomp/src/ChannelEndPoint.h index 4c0c728f3..652492485 100644 --- a/nxcomp/src/ChannelEndPoint.h +++ b/nxcomp/src/ChannelEndPoint.h @@ -46,6 +46,7 @@ class ChannelEndPoint ~ChannelEndPoint(); ChannelEndPoint &operator=(const ChannelEndPoint &other); + bool configured() const; bool enabled() const; bool disabled() { return !enabled(); } void disable(); diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp index f76c22dea..4292e7b9a 100644 --- a/nxcomp/src/Loop.cpp +++ b/nxcomp/src/Loop.cpp @@ -11746,20 +11746,22 @@ int SetPorts() << logofs_flush; #endif - if (control -> ProxyMode == proxy_client) { - mediaPort.setDefaultTCPPort(DEFAULT_NX_MEDIA_PORT_OFFSET + proxyPort); - useMediaSocket = mediaPort.enabled(); - } else { + if ( mediaPort.configured() ) { + if (control -> ProxyMode == proxy_client) { + mediaPort.setDefaultTCPPort(DEFAULT_NX_MEDIA_PORT_OFFSET + proxyPort); + useMediaSocket = mediaPort.enabled(); + } else { - if ( !mediaPort.enabled() ) { - #ifdef PANIC - *logofs << "Loop: PANIC! No port specified for multimedia connections.\n" - << logofs_flush; - #endif + if ( mediaPort.getTCPPort() < 0 ) { + #ifdef PANIC + *logofs << "Loop: PANIC! No port specified for multimedia connections.\n" + << logofs_flush; + #endif - cerr << "Error" << ": No port specified for multimedia connections.\n"; + cerr << "Error" << ": No port specified for multimedia connections.\n"; - HandleCleanup(); + HandleCleanup(); + } } } |