summaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-20 08:32:34 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-20 08:32:34 -0400
commitd7301a456ab15ab84030b6e0fcf5a6fbd9e43fa9 (patch)
treeba7ea25540b279dc04b7b89ff01cdab72293e6eb /src/or/nodelist.c
parente9c93a3415fac4660f3976dfcd7cfd2db5502e58 (diff)
parent9d7f148885a9334605cfb396bb06ad546349ad6a (diff)
downloadtor-d7301a456ab15ab84030b6e0fcf5a6fbd9e43fa9.tar.gz
tor-d7301a456ab15ab84030b6e0fcf5a6fbd9e43fa9.zip
Merge remote-tracking branch 'neel/b25886c'
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r--src/or/nodelist.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 39b63eeae8..5ad91227a8 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -2260,9 +2260,14 @@ compute_frac_paths_available(const networkstatus_t *consensus,
* browsing (as distinct from hidden service web browsing). */
}
- f_guard = frac_nodes_with_descriptors(guards, WEIGHT_FOR_GUARD);
- f_mid = frac_nodes_with_descriptors(mid, WEIGHT_FOR_MID);
- f_exit = frac_nodes_with_descriptors(exits, WEIGHT_FOR_EXIT);
+ f_guard = frac_nodes_with_descriptors(guards, WEIGHT_FOR_GUARD, 1);
+ f_mid = frac_nodes_with_descriptors(mid, WEIGHT_FOR_MID, 0);
+ f_exit = frac_nodes_with_descriptors(exits, WEIGHT_FOR_EXIT, 0);
+
+ /* If we are using bridges and have at least one bridge with a full
+ * descriptor, assume f_guard is 1.0. */
+ if (options->UseBridges && num_bridges_usable(0) > 0)
+ f_guard = 1.0;
log_debug(LD_NET,
"f_guard: %.2f, f_mid: %.2f, f_exit: %.2f",
@@ -2316,9 +2321,10 @@ compute_frac_paths_available(const networkstatus_t *consensus,
np,
nu);
- f_myexit= frac_nodes_with_descriptors(myexits,WEIGHT_FOR_EXIT);
+ f_myexit= frac_nodes_with_descriptors(myexits, WEIGHT_FOR_EXIT, 0);
f_myexit_unflagged=
- frac_nodes_with_descriptors(myexits_unflagged,WEIGHT_FOR_EXIT);
+ frac_nodes_with_descriptors(myexits_unflagged,
+ WEIGHT_FOR_EXIT, 0);
log_debug(LD_NET,
"f_exit: %.2f, f_myexit: %.2f, f_myexit_unflagged: %.2f",