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