summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-07 18:07:44 +1100
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-16 04:37:59 +1100
commit2212530bf59acb95ca9bb0278e51306e847105b7 (patch)
tree9df5a73b901d2f282656d1990770046fdafa81d7 /src/or/main.c
parent35bbf2e4a4e8ccbc4126ebffda67c48989ec2f06 (diff)
downloadtor-2212530bf59acb95ca9bb0278e51306e847105b7.tar.gz
tor-2212530bf59acb95ca9bb0278e51306e847105b7.zip
Prop210: Close excess connections once a consensus is downloading
Once tor is downloading a usable consensus, any other connection attempts are not needed. Choose a connection to keep, favouring: * fallback directories over authorities, * connections initiated earlier over later connections Close all other connections downloading a consensus.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 60957bd6ab..455cba4513 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1460,6 +1460,11 @@ run_scheduled_events(time_t now)
dirvote_act(options, now);
}
+ /* 2d. Cleanup excess consensus bootstrap connections every second.
+ * connection_dir_close_consensus_conn_if_extra() will close connections
+ * that are clearly excess, but this check is more thorough. */
+ connection_dir_close_extra_consensus_conns();
+
/* 3a. Every second, we examine pending circuits and prune the
* ones which have been pending for more than a few seconds.
* We do this before step 4, so it can try building more if