Commit 66cb0be3 authored by Matt Traudt's avatar Matt Traudt
Browse files

Make circuit timeout configurable

parent 2727e20e
......@@ -21,6 +21,12 @@ data_period = 5
# timeout between bytes received from the server. See
# http://docs.python-requests.org/en/master/user/advanced/#timeouts
http_timeout = 10
# Timeout in seconds for waiting on a circuit to be built. It MUST be an
# **int**. We will use this both as the CircuitBuildTimeout and a timeout
# to give to stem for waiting on a circuit to be built since
# CircuitBuildTimeout doesn't handle the case of a TLS connection to a relay
# taking forever, and probably other not-yet-discovered cases.
circuit_timeout = 10
[scanner]
# A human-readable string with chars in a-zA-Z0-9 to identify your scanner
......
......@@ -20,9 +20,6 @@ TORRC_STARTING_POINT = {
'SocksPort': 'auto',
# Easier than password authentication
'CookieAuthentication': '1',
# Things needed to make circuits fail a little faster
'LearnCircuitBuildTimeout': '0',
'CircuitBuildTimeout': '10',
# To avoid path bias warnings
'UseEntryGuards': '0',
}
......
......@@ -126,6 +126,7 @@ def _validate_general(conf):
err_tmpl = Template('$sec/$key ($val): $e')
ints = {
'data_period': {'minimum': 1, 'maximum': None},
'circuit_timeout': {'minimum': 1, 'maximum': None},
}
floats = {
'http_timeout': {'minimum': 0.0, 'maximum': None},
......
......@@ -126,6 +126,11 @@ def launch_tor(conf):
'Log': [
'NOTICE file {}'.format(section['log']),
],
# Things needed to make circuits fail a little faster. We get the
# circuit_timeout as a string instead of an int on purpose: stem only
# accepts strings.
'LearnCircuitBuildTimeout': '0',
'CircuitBuildTimeout': conf['general']['circuit_timeout'],
})
# This block of code reads additional torrc lines from the user's
# config.ini so they can add arbitrary additional options.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment