[svn r37318] Rolling back previous change, instead applying what seems to have been the intention from the start: if '' is supplied as hostname from the server, use the IP address as reported by socket.getsockname()

--HG--
branch : trunk
This commit is contained in:
guido 2007-01-25 11:25:40 +01:00
parent 039ec87c64
commit ed55fea143
1 changed files with 2 additions and 6 deletions

View File

@ -145,9 +145,7 @@ class SocketGateway(InstallableGateway):
given gateway. given gateway.
""" """
if hostport is None: if hostport is None:
# XXX not sure about this one... is this what's intended? it used host, port = ('', 0)
# to use '' for the hostname, which breaks Windows...
host, port = ('127.0.0.1', 0)
else: else:
host, port = hostport host, port = hostport
socketserverbootstrap = py.code.Source( socketserverbootstrap = py.code.Source(
@ -163,12 +161,10 @@ class SocketGateway(InstallableGateway):
channel = gateway.remote_exec(socketserverbootstrap) channel = gateway.remote_exec(socketserverbootstrap)
hostname, (realhost, realport) = channel.receive() hostname, (realhost, realport) = channel.receive()
if not hostname: if not hostname:
# XXX this is strange... shouldn't it be 'realhost = hostname' or
# something?
hostname = realhost hostname = realhost
#gateway._trace("remote_install received" #gateway._trace("remote_install received"
# "port=%r, hostname = %r" %(realport, hostname)) # "port=%r, hostname = %r" %(realport, hostname))
return py.execnet.SocketGateway(realhost, realport) return py.execnet.SocketGateway(hostname, realport)
remote_install = classmethod(remote_install) remote_install = classmethod(remote_install)
class SshGateway(PopenCmdGateway): class SshGateway(PopenCmdGateway):