[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Add a missing bridge download status reset
commit 1b5e34badb06bb1a844a6e70164fc5c894d95d0a
Author: teor <teor2345@xxxxxxxxx>
Date: Mon Sep 11 14:03:42 2017 +1000
Add a missing bridge download status reset
17750 made unused download schedules automatically reset.
But we should make that explicit.
---
src/or/bridges.c | 2 ++
src/test/test_entrynodes.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/src/or/bridges.c b/src/or/bridges.c
index 257bb8920..461f86260 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -455,6 +455,8 @@ bridge_add_from_config(bridge_line_t *bridge_line)
b->fetch_status.schedule = DL_SCHED_BRIDGE;
b->fetch_status.backoff = DL_SCHED_RANDOM_EXPONENTIAL;
b->fetch_status.increment_on = DL_SCHED_INCREMENT_ATTEMPT;
+ /* This will fail if UseBridges is not set */
+ download_status_reset(&b->fetch_status);
b->socks_args = bridge_line->socks_args;
if (!bridge_list)
bridge_list = smartlist_new();
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index f30bb5ffa..d87670d82 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -917,6 +917,7 @@ test_entry_guard_node_filter(void *arg)
routerset_parse(get_options_mutable()->ExcludeNodes, "144.144.0.0/16", "");
/* 4: Bridge. */
+ get_options_mutable()->UseBridges = 1;
sweep_bridge_list();
bl = tor_malloc_zero(sizeof(bridge_line_t));
tor_addr_from_ipv4h(&bl->addr, n[4]->rs->addr);
@@ -924,6 +925,7 @@ test_entry_guard_node_filter(void *arg)
memcpy(bl->digest, n[4]->identity, 20);
bridge_add_from_config(bl);
bl = NULL; // prevent free.
+ get_options_mutable()->UseBridges = 0;
/* 5: Unreachable. This stays in the filter, but isn't in usable-filtered */
g[5]->last_tried_to_connect = approx_time(); // prevent retry.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits