summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-25 21:32:04 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-25 21:32:04 +0000
commit28f034e10a6b2834ad93b7922f9c136da6de2e38 (patch)
tree8ca37aaa6c3a6611d5d76a6b2482aa0d7dec0219
parentdb814b1276b49d96a4d83d9bc9eed2adfb415558 (diff)
downloadtor-28f034e10a6b2834ad93b7922f9c136da6de2e38.tar.gz
tor-28f034e10a6b2834ad93b7922f9c136da6de2e38.zip
now assume all routers support rendezvous cells
svn:r1699
-rw-r--r--src/or/onion.c6
-rw-r--r--src/or/or.h2
-rw-r--r--src/or/rendservice.c8
-rw-r--r--src/or/routerlist.c18
4 files changed, 3 insertions, 31 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index 28afe68ba0..4eaf39fa89 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -348,16 +348,12 @@ static routerinfo_t *choose_good_exit_server_general(routerlist_t *dir)
static routerinfo_t *choose_good_exit_server(uint8_t purpose, routerlist_t *dir)
{
- smartlist_t *obsolete_routers;
routerinfo_t *r;
switch(purpose) {
case CIRCUIT_PURPOSE_C_GENERAL:
return choose_good_exit_server_general(dir);
case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
- obsolete_routers = smartlist_create();
- router_add_nonrendezvous_to_list(obsolete_routers);
- r = router_choose_random_node(dir, options.RendNodes, options.RendExcludeNodes, obsolete_routers);
- smartlist_free(obsolete_routers);
+ r = router_choose_random_node(dir, options.RendNodes, options.RendExcludeNodes, NULL);
return r;
default:
log_fn(LOG_WARN,"unhandled purpose %d", purpose);
diff --git a/src/or/or.h b/src/or/or.h
index a48fa044f8..f3f28f4dae 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -999,8 +999,6 @@ routerinfo_t *router_get_by_nickname(char *nickname);
void router_get_routerlist(routerlist_t **prouterlist);
void routerinfo_free(routerinfo_t *router);
routerinfo_t *routerinfo_copy(const routerinfo_t *router);
-int router_version_supports_rendezvous(routerinfo_t *router);
-void router_add_nonrendezvous_to_list(smartlist_t *sl);
void router_mark_as_down(char *nickname);
int router_set_routerlist_from_file(char *routerfile);
int router_set_routerlist_from_string(const char *s);
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index fbb710e5b5..8b354b658e 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -752,13 +752,10 @@ void rend_services_introduce(void) {
char *intro;
int changed, prev_intro_nodes;
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);
@@ -809,9 +806,8 @@ void rend_services_introduce(void) {
service->service_id);
}
- /* Reset exclude_routers to include obsolete routers only for the next
- * time around the loop. */
- smartlist_truncate(exclude_routers, n_old_routers);
+ /* Reset exclude_routers, for the next time around the loop. */
+ smartlist_clear(exclude_routers);
/* If there's no need to launch new circuits, stop here. */
if (!changed)
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 4b82d911a9..3c01838dc0 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -236,24 +236,6 @@ void router_add_running_routers_to_smartlist(smartlist_t *sl) {
}
}
-/* Return 0 if router is running a version of Tor too old to be a
- * rendezvous/introduction point. Return 1 otherwise.
- */
-int router_version_supports_rendezvous(routerinfo_t *router)
-{
- return (router->platform && 0!=strncasecmp(router->platform,"Tor 0.0.5",9));
-}
-
-/* Add every router running a version of Tor too old for rend/intro
- points to sl.
- */
-void router_add_nonrendezvous_to_list(smartlist_t *sl)
-{
- SMARTLIST_FOREACH(routerlist->routers, routerinfo_t *, r,
- if (!router_version_supports_rendezvous(r))
- smartlist_add(sl,r));
-}
-
/* Pick a random node from preferred if possible, else from all of dir.
* Never pick a node in excluded.
* If excludedsmartlist is defined, never pick a node in it either.