Rev838, Better running Tor detection

This commit is contained in:
HelloZeroNet 2016-01-09 01:17:04 +01:00
parent 44a68104fb
commit 7d35797749
2 changed files with 2 additions and 8 deletions

View file

@ -8,7 +8,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.3.5"
self.rev = 833
self.rev = 838
self.argv = argv
self.action = None
self.createParser()

View file

@ -52,13 +52,7 @@ class TorManager:
# Test proxy port
if config.tor != "disable":
try:
if "socket_noproxy" in dir(socket): # Socket proxy-patched, use non-proxy one
self.log.debug("Socket proxy patched, using original")
conn = socket.socket_noproxy(socket.AF_INET, socket.SOCK_STREAM)
else:
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.settimeout(1)
conn.connect((self.proxy_ip, self.proxy_port))
assert self.connect(), "No connection"
self.log.debug("Tor proxy port %s check ok" % config.tor_proxy)
except Exception, err:
self.log.debug("Tor proxy port %s check error: %s" % (config.tor_proxy, err))