aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/Loop.cpp
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-12-14 13:32:23 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-12-14 13:32:23 +0100
commit8be276d2715544f0db3dc0dca84e2da06ced99ae (patch)
tree7a402d5a65ace7b18d0db0cc13fe5b31c2276758 /nxcomp/Loop.cpp
parente466a9387d4db49784276b9b0eabf8f49f01b87f (diff)
parent920f423a59b568cf91128f8e1fa8374e521141ca (diff)
downloadnx-libs-8be276d2715544f0db3dc0dca84e2da06ced99ae.tar.gz
nx-libs-8be276d2715544f0db3dc0dca84e2da06ced99ae.tar.bz2
nx-libs-8be276d2715544f0db3dc0dca84e2da06ced99ae.zip
Merge branch 'theqvd-fix-loopback-bind' into 3.6.x
Attributes GH PR #299: https://github.com/ArcticaProject/nx-libs/pull/299
Diffstat (limited to 'nxcomp/Loop.cpp')
-rw-r--r--nxcomp/Loop.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp
index c566aa2d1..86c951a06 100644
--- a/nxcomp/Loop.cpp
+++ b/nxcomp/Loop.cpp
@@ -6692,11 +6692,15 @@ int WaitForRemote(ChannelEndPoint &socketAddress)
strcpy(hostLabel, "any host");
}
- if (loopbackBind)
+ long bindPort;
+ if (socketAddress.getTCPHostAndPort(NULL, &bindPort))
{
- long bindPort;
- if (socketAddress.getTCPHostAndPort(NULL, &bindPort))
- socketAddress.setSpec("localhost", bindPort);
+ socketAddress.setSpec(loopbackBind ? "localhost" : "*", bindPort);
+ }
+ else
+ {
+ // This should never happen
+ cerr << "Error" << ": Unable to change bind host\n";
}
}
else if (socketAddress.isUnixSocket())