Skip to content

Commit

Permalink
Rev838, Better running Tor detection
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Jan 9, 2016
1 parent 44a6810 commit 7d35797
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 1 addition & 7 deletions src/Tor/TorManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ def __init__(self, fileserver_ip=None, fileserver_port=None):
# 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))
Expand Down

0 comments on commit 7d35797

Please sign in to comment.