[or-cvs] router_choose_random_node() was ignoring its routerlist arg...

Roger Dingledine arma at seul.org
Thu May 20 19:12:31 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	circuitbuild.c or.h rendservice.c routerlist.c 
Log Message:
router_choose_random_node() was ignoring its routerlist argument.
so now we don't pass it one.


Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuitbuild.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- circuitbuild.c	13 May 2004 07:24:49 -0000	1.1
+++ circuitbuild.c	20 May 2004 19:12:28 -0000	1.2
@@ -855,7 +855,7 @@
     case CIRCUIT_PURPOSE_C_GENERAL:
       return choose_good_exit_server_general(dir);
     case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
-      r = router_choose_random_node(dir, options.RendNodes, options.RendExcludeNodes, NULL);
+      r = router_choose_random_node(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.354
retrieving revision 1.355
diff -u -d -r1.354 -r1.355
--- or.h	20 May 2004 05:10:30 -0000	1.354
+++ or.h	20 May 2004 19:12:28 -0000	1.355
@@ -1292,8 +1292,7 @@
 struct smartlist_t;
 void add_nickname_list_to_smartlist(struct smartlist_t *sl, const char *list);
 void router_add_running_routers_to_smartlist(struct smartlist_t *sl);
-routerinfo_t *router_choose_random_node(routerlist_t *dir,
-                                        char *preferred, char *excluded,
+routerinfo_t *router_choose_random_node(char *preferred, char *excluded,
                                         struct smartlist_t *excludedsmartlist);
 routerinfo_t *router_get_by_addr_port(uint32_t addr, uint16_t port);
 routerinfo_t *router_get_by_nickname(char *nickname);

Index: rendservice.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendservice.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- rendservice.c	18 May 2004 15:35:21 -0000	1.70
+++ rendservice.c	20 May 2004 19:12:28 -0000	1.71
@@ -772,14 +772,12 @@
 void rend_services_introduce(void) {
   int i,j,r;
   routerinfo_t *router;
-  routerlist_t *rl;
   rend_service_t *service;
   char *intro;
   int changed, prev_intro_nodes;
   smartlist_t *intro_routers, *exclude_routers;
   time_t now;
 
-  router_get_routerlist(&rl);
   intro_routers = smartlist_create();
   exclude_routers = smartlist_create();
   now = time(NULL);
@@ -830,8 +828,7 @@
     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,
+      router = router_choose_random_node(service->intro_prefer_nodes,
                                          service->intro_exclude_nodes,
                                          exclude_routers);
       if (!router) {

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- routerlist.c	20 May 2004 06:42:38 -0000	1.81
+++ routerlist.c	20 May 2004 19:12:28 -0000	1.82
@@ -149,13 +149,12 @@
   }
 }
 
-/** Pick a random running router from a routerlist <b>dir</b>.  If any node
+/** Return a random running router from the routerlist.  If any node
  * named in <b>preferred</b> is available, pick one of those.  Never pick a
  * node named in <b>excluded</b>, or whose routerinfo is in
  * <b>excludedsmartlist</b>, even if they are the only nodes available.
  */
-routerinfo_t *router_choose_random_node(routerlist_t *dir,
-                                        char *preferred, char *excluded,
+routerinfo_t *router_choose_random_node(char *preferred, char *excluded,
                                         smartlist_t *excludedsmartlist)
 {
   smartlist_t *sl, *excludednodes;



More information about the tor-commits mailing list