summaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-07-18 18:36:32 +0000
committerNick Mathewson <nickm@torproject.org>2008-07-18 18:36:32 +0000
commitc8160bce1ffa9ed050de7d3448ba16b013b7a0e0 (patch)
tree3e3175249c41cb92b7dea03eceb0a69b85913e9b /src/or/rendservice.c
parentf2550a52d46a6269863ac2e17774798c3a8533fd (diff)
downloadtor-c8160bce1ffa9ed050de7d3448ba16b013b7a0e0.tar.gz
tor-c8160bce1ffa9ed050de7d3448ba16b013b7a0e0.zip
r17188@tombo: nickm | 2008-07-18 14:35:18 -0400
Add new ExcludeExitNodes option. Also add a new routerset type to handle Exclude[Exit]Nodes. It is optimized for O(1) membership tests, so as to make choosing a random router run in O(N_routers) time instead of in O(N_routers*N_Excluded_Routers). svn:r16061
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 1965b12859..5e739c5285 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1229,6 +1229,7 @@ rend_services_introduce(void)
int changed, prev_intro_nodes;
smartlist_t *intro_routers, *exclude_routers;
time_t now;
+ or_options_t *options = get_options();
intro_routers = smartlist_create();
exclude_routers = smartlist_create();
@@ -1303,7 +1304,8 @@ rend_services_introduce(void)
/* The directory is now here. Pick three ORs as intro points. */
for (j=prev_intro_nodes; j < NUM_INTRO_POINTS; ++j) {
router = router_choose_random_node(service->intro_prefer_nodes,
- service->intro_exclude_nodes, exclude_routers, 1, 0, 0,
+ service->intro_exclude_nodes, exclude_routers,
+ options->ExcludeNodes, 1, 0, 0,
get_options()->_AllowInvalid & ALLOW_INVALID_INTRODUCTION,
0, 0);
if (!router) {