Commit f2c73bd8 authored by Vadim Troshchinskiy's avatar Vadim Troshchinskiy

Fix bug #525: PANIC! No port specified for multimedia connections

Commit 5f1eb0dc introduced a regression that made the use of the multimedia port mandatory. Fixes ArcticaProject/nx-libs#525
parent 17ae45e0
...@@ -312,6 +312,11 @@ ChannelEndPoint::enabled() const { ...@@ -312,6 +312,11 @@ ChannelEndPoint::enabled() const {
} }
bool bool
ChannelEndPoint::configured() const {
return ( spec_ && ( strcmp(spec_, "0") != 0) );
}
bool
ChannelEndPoint::validateSpec() { ChannelEndPoint::validateSpec() {
isTCP_ = getTCPHostAndPort(); isTCP_ = getTCPHostAndPort();
isUnix_ = getUnixPath(); isUnix_ = getUnixPath();
......
...@@ -46,6 +46,7 @@ class ChannelEndPoint ...@@ -46,6 +46,7 @@ class ChannelEndPoint
~ChannelEndPoint(); ~ChannelEndPoint();
ChannelEndPoint &operator=(const ChannelEndPoint &other); ChannelEndPoint &operator=(const ChannelEndPoint &other);
bool configured() const;
bool enabled() const; bool enabled() const;
bool disabled() { return !enabled(); } bool disabled() { return !enabled(); }
void disable(); void disable();
......
...@@ -11746,20 +11746,22 @@ int SetPorts() ...@@ -11746,20 +11746,22 @@ int SetPorts()
<< logofs_flush; << logofs_flush;
#endif #endif
if (control -> ProxyMode == proxy_client) { if ( mediaPort.configured() ) {
mediaPort.setDefaultTCPPort(DEFAULT_NX_MEDIA_PORT_OFFSET + proxyPort); if (control -> ProxyMode == proxy_client) {
useMediaSocket = mediaPort.enabled(); mediaPort.setDefaultTCPPort(DEFAULT_NX_MEDIA_PORT_OFFSET + proxyPort);
} else { useMediaSocket = mediaPort.enabled();
} else {
if ( !mediaPort.enabled() ) { if ( mediaPort.getTCPPort() < 0 ) {
#ifdef PANIC #ifdef PANIC
*logofs << "Loop: PANIC! No port specified for multimedia connections.\n" *logofs << "Loop: PANIC! No port specified for multimedia connections.\n"
<< logofs_flush; << logofs_flush;
#endif #endif
cerr << "Error" << ": No port specified for multimedia connections.\n"; cerr << "Error" << ": No port specified for multimedia connections.\n";
HandleCleanup(); HandleCleanup();
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment