Commit eeb619ed authored by anonym's avatar anonym
Browse files

Merge branch 'stable' into devel

parents 8271120d 3bc86896
......@@ -98,7 +98,15 @@ end
def force_new_tor_circuit()
debug_log("Forcing new Tor circuit...")
# Tor rate limits NEWNYM to at most one per 10 second period.
rate = 10
if $__last_newnym
elapsed = Time.now - $__last_newnym
# We sleep an extra second to avoid tight timings.
sleep rate - elapsed + 1 if 0 < elapsed && elapsed < rate
end
$vm.execute_successfully('tor_control_send "signal NEWNYM"', :libs => 'tor')
$__last_newnym = Time.now
end
# This will retry the block up to MAX_NEW_TOR_CIRCUIT_RETRIES
......
Markdown is supported
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