summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-05-20 19:12:28 +0000
committerRoger Dingledine <arma@torproject.org>2004-05-20 19:12:28 +0000
commit1c21a02b90a7cef6d56589194f22b2a7f4f35f95 (patch)
treed62e10c1576448afa96a44fda926a653bd4468a4
parent66dd21b7a44d3e194029fac99fe986adac9940a7 (diff)
downloadtor-1c21a02b90a7cef6d56589194f22b2a7f4f35f95.tar.gz
tor-1c21a02b90a7cef6d56589194f22b2a7f4f35f95.zip
router_choose_random_node() was ignoring its routerlist argument.
so now we don't pass it one. svn:r1911
-rw-r--r--src/or/circuitbuild.c2
-rw-r--r--src/or/or.h3
-rw-r--r--src/or/rendservice.c5
-rw-r--r--src/or/routerlist.c5
4 files changed, 5 insertions, 10 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 5556fd8e41..88bdc301e5 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -855,7 +855,7 @@ static routerinfo_t *choose_good_exit_server(uint8_t purpose, routerlist_t *dir)
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);
diff --git a/src/or/or.h b/src/or/or.h
index 88bd8ee56a..d0f0c59e9e 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1292,8 +1292,7 @@ routerinfo_t *router_pick_directory_server(void);
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);
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index b5e86a4d89..296f60876e 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -772,14 +772,12 @@ upload_service_descriptor(rend_service_t *service)
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 @@ void rend_services_introduce(void) {
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) {
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 5dca80370f..98cd402b1c 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -149,13 +149,12 @@ void router_add_running_routers_to_smartlist(smartlist_t *sl) {
}
}
-/** 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;