mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1163992 - [moznetwork] When multiple IPs are found on Windows pick the first one. r=wlachance
This commit is contained in:
parent
d544362e3d
commit
143c19534e
@ -120,8 +120,11 @@ def get_ip():
|
|||||||
ips = socket.gethostbyname_ex(hostname)[2]
|
ips = socket.gethostbyname_ex(hostname)[2]
|
||||||
if len(ips) == 1:
|
if len(ips) == 1:
|
||||||
ip = ips[0]
|
ip = ips[0]
|
||||||
else:
|
elif len(ips) > 1:
|
||||||
logger.debug('Multiple addresses found: %s' % ips)
|
logger.debug('Multiple addresses found: %s' % ips)
|
||||||
|
# no fallback on Windows so take the first address
|
||||||
|
ip = ips[0] if mozinfo.isWin else None
|
||||||
|
else:
|
||||||
ip = None
|
ip = None
|
||||||
except socket.gaierror:
|
except socket.gaierror:
|
||||||
# sometimes the hostname doesn't resolve to an ip address, in which
|
# sometimes the hostname doesn't resolve to an ip address, in which
|
||||||
|
Loading…
Reference in New Issue
Block a user