aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-06 21:19:59 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-06 21:19:59 +0000
commit8b371c2aa536c30926bcf48e1ff2a756e139a08d (patch)
treeb33b19f97f8e1d897e0b48df797a2009ab921ad6 /src/or/rendservice.c
parent2fc106d2101edd80a7ba8cdcc9f49522619ba9cf (diff)
downloadtor-8b371c2aa536c30926bcf48e1ff2a756e139a08d.tar
tor-8b371c2aa536c30926bcf48e1ff2a756e139a08d.tar.gz
router_choose_random_node wants a smartlist of routers, not of nicknames.
svn:r1510
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 4325ec9e7..6029ad89d 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -651,10 +651,13 @@ int rend_services_init(void) {
rend_service_t *service;
char *desc, *intro;
int changed, prev_intro_nodes, desc_len;
+ smartlist_t *intro_routers;
router_get_routerlist(&rl);
+ intro_routers = smartlist_create();
for (i=0; i< smartlist_len(rend_service_list); ++i) {
+ smartlist_clear(intro_routers);
service = smartlist_get(rend_service_list, i);
assert(service);
@@ -667,6 +670,7 @@ int rend_services_init(void) {
smartlist_del(service->intro_nodes,j--);
changed = 1;
}
+ smartlist_add(intro_routers, router);
}
/* We have enough intro points, and the intro points we thought we had were
@@ -683,13 +687,14 @@ int rend_services_init(void) {
router = router_choose_random_node(rl,
service->intro_prefer_nodes,
service->intro_exclude_nodes,
- service->intro_nodes);
+ intro_routers);
if (!router) {
log_fn(LOG_WARN, "Can't establish more than %d introduction points",
smartlist_len(service->intro_nodes));
break;
}
changed = 1;
+ smartlist_add(intro_routers, router);
smartlist_add(service->intro_nodes, tor_strdup(router->nickname));
}
@@ -719,6 +724,8 @@ int rend_services_init(void) {
}
}
}
+ smartlist_free(intro_routers);
+
return 0;
}