[or-cvs] now assume all routers support rendezvous cells
Roger Dingledine
arma at seul.org
Sun Apr 25 21:32:07 UTC 2004
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or
Modified Files:
onion.c or.h rendservice.c routerlist.c
Log Message:
now assume all routers support rendezvous cells
Index: onion.c
===================================================================
RCS file: /home/or/cvsroot/src/or/onion.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- onion.c 25 Apr 2004 20:37:37 -0000 1.158
+++ onion.c 25 Apr 2004 21:32:04 -0000 1.159
@@ -348,16 +348,12 @@
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);
Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.324
retrieving revision 1.325
diff -u -d -r1.324 -r1.325
--- or.h 25 Apr 2004 19:04:11 -0000 1.324
+++ or.h 25 Apr 2004 21:32:04 -0000 1.325
@@ -999,8 +999,6 @@
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);
Index: rendservice.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendservice.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- rendservice.c 25 Apr 2004 20:37:37 -0000 1.58
+++ rendservice.c 25 Apr 2004 21:32:04 -0000 1.59
@@ -752,13 +752,10 @@
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 @@
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)
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- routerlist.c 25 Apr 2004 20:37:37 -0000 1.64
+++ routerlist.c 25 Apr 2004 21:32:04 -0000 1.65
@@ -236,24 +236,6 @@
}
}
-/* 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.
More information about the tor-commits
mailing list