Rev838, Better running Tor detection
This commit is contained in:
parent
44a68104fb
commit
7d35797749
2 changed files with 2 additions and 8 deletions
|
@ -8,7 +8,7 @@ class Config(object):
|
||||||
|
|
||||||
def __init__(self, argv):
|
def __init__(self, argv):
|
||||||
self.version = "0.3.5"
|
self.version = "0.3.5"
|
||||||
self.rev = 833
|
self.rev = 838
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
self.action = None
|
self.action = None
|
||||||
self.createParser()
|
self.createParser()
|
||||||
|
|
|
@ -52,13 +52,7 @@ class TorManager:
|
||||||
# Test proxy port
|
# Test proxy port
|
||||||
if config.tor != "disable":
|
if config.tor != "disable":
|
||||||
try:
|
try:
|
||||||
if "socket_noproxy" in dir(socket): # Socket proxy-patched, use non-proxy one
|
assert self.connect(), "No connection"
|
||||||
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))
|
|
||||||
self.log.debug("Tor proxy port %s check ok" % config.tor_proxy)
|
self.log.debug("Tor proxy port %s check ok" % config.tor_proxy)
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
self.log.debug("Tor proxy port %s check error: %s" % (config.tor_proxy, err))
|
self.log.debug("Tor proxy port %s check error: %s" % (config.tor_proxy, err))
|
||||||
|
|
Loading…
Reference in a new issue