diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-07 21:36:03 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-07 21:36:03 +0000 |
commit | 8169da5c30cbea7c73f5d0f56d1a507703aa48cc (patch) | |
tree | 585eb5c25e87798ee35f2ece02bc52bd86d3fadf /src/or/rendservice.c | |
parent | 7c7301fe926a9ca0f48ed645f3c4a92466477ce1 (diff) | |
download | tor-8169da5c30cbea7c73f5d0f56d1a507703aa48cc.tar.gz tor-8169da5c30cbea7c73f5d0f56d1a507703aa48cc.zip |
Don't use Tor version 0.0.5 for intro/rendezvous points. (We don't need
to worry about 0.0.4 or earlier, because nobody is running them any more.)
svn:r1533
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index be7ddcb1ee..2042b6bb4e 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -657,10 +657,14 @@ int rend_services_init(void) { rend_service_t *service; char *desc, *intro; int changed, prev_intro_nodes, desc_len; - smartlist_t *intro_routers; + smartlist_t *intro_routers, *exclude_routers; + int n_old_routers; router_get_routerlist(&rl); intro_routers = smartlist_create(); + exclude_routers = smartlist_create(); + router_add_nonrendezvous_to_list(exclude_routers); + n_old_routers = smartlist_len(exclude_routers); for (i=0; i< smartlist_len(rend_service_list); ++i) { smartlist_clear(intro_routers); @@ -688,12 +692,13 @@ int rend_services_init(void) { /* Remember how many introduction circuits we started with. */ prev_intro_nodes = smartlist_len(service->intro_nodes); + smartlist_add_all(exclude_routers, intro_routers); /* 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(rl, service->intro_prefer_nodes, service->intro_exclude_nodes, - intro_routers); + exclude_routers); if (!router) { log_fn(LOG_WARN, "Can't establish more than %d introduction points", smartlist_len(service->intro_nodes)); @@ -701,9 +706,14 @@ int rend_services_init(void) { } changed = 1; smartlist_add(intro_routers, router); + smartlist_add(exclude_routers, router); smartlist_add(service->intro_nodes, tor_strdup(router->nickname)); } + /* Reset exclude_routers to include obsolete routers only for the next + * time around the loop. */ + smartlist_truncate(exclude_routers, n_old_routers); + /* If there's no need to republish, stop here. */ if (!changed) continue; @@ -731,6 +741,7 @@ int rend_services_init(void) { } } smartlist_free(intro_routers); + smartlist_free(exclude_routers); return 0; } |