GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still and

Verified Commit 88d8f0a8 authored by Philipp Winter's avatar Philipp Winter
Browse files

Try waking up tor before giving it new bridges.

By default, tor goes to sleep after 24 hours of no user activity.
Bridgestrap's control port interaction does not count as user activity,
which means that tor effectively stops working after 24 hours.  To work
around this, we're sending tor a SIGNAL ACTIVE, which wakes up tor in
case it went to sleep.  This is a cheap thing to do, so we might as well
do it before each SETCONF.

This patch fixes #12.
parent 6d3ae38c
......@@ -200,6 +200,16 @@ func (c *TorContext) TestBridgeLines(bridgeLines []string) *TestResult {
result := NewTestResult()
log.Printf("Testing %d bridge lines.", len(bridgeLines))
// By default, Tor enters dormant mode 24 hours after seeing no user
// activity. Bridgestrap's control port interaction doesn't count as user
// activity, which is why we explicitly wake up Tor before issuing our
// SETCONF. See the following issue for more details:
if _, err := c.Ctrl.Request("SIGNAL ACTIVE"); err != nil {
result.Error = err.Error()
return result
// Create our SETCONF line, which tells Tor what bridges it should test.
// It has the following format:
// SETCONF Bridge="BRIDGE1" Bridge="BRIDGE2" ...
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