Socks proxy hostname resolving error handling

- if resolving fails, it wasn't handled
master
Peter Šurda 6 years ago
parent 7ebe837eb0
commit 88658b074e
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

@ -87,8 +87,12 @@ def checkSocksIP(host):
try:
if state.socksIP is None or not state.socksIP:
state.socksIP = socket.gethostbyname(BMConfigParser().get("bitmessagesettings", "sockshostname"))
# uninitialised
except NameError:
state.socksIP = socket.gethostbyname(BMConfigParser().get("bitmessagesettings", "sockshostname"))
# resolving failure
except socket.gaierror:
state.socksIP = BMConfigParser().get("bitmessagesettings", "sockshostname")
return state.socksIP == host
def isProofOfWorkSufficient(data,

Loading…
Cancel
Save