aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
parentdb814b1276b49d96a4d83d9bc9eed2adfb415558 (diff)
downloadtor-28f034e10a6b2834ad93b7922f9c136da6de2e38.tar
tor-28f034e10a6b2834ad93b7922f9c136da6de2e38.tar.gz
now assume all routers support rendezvous cells
svn:r1699
Diffstat (limited to 'src')
-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 28afe68ba..4eaf39fa8 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 a48fa044f..f3f28f4da 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 fbb710e5b..8b354b658 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 4b82d911a..3c01838dc 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.