summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-18 06:10:12 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-18 06:10:12 +0000
commitb294a037a451b097ebcf0c5ebb3c48daff1ff052 (patch)
treec656a34b90a8c43efb55196d4918fed409fb2f42
parent6de61bd6946b2520e0668809b3aa0283191b8bd8 (diff)
downloadtor-b294a037a451b097ebcf0c5ebb3c48daff1ff052.tar.gz
tor-b294a037a451b097ebcf0c5ebb3c48daff1ff052.zip
choose exit nodes by bandwidth too
svn:r2274
-rw-r--r--src/or/circuitbuild.c4
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/routerlist.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 2dac67d811..a5863cce17 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -909,7 +909,7 @@ static routerinfo_t *choose_good_exit_server_general(routerlist_t *dir)
smartlist_subtract(sl,excludedexits);
if (options.StrictExitNodes || smartlist_overlap(sl,preferredexits))
smartlist_intersect(sl,preferredexits);
- router = smartlist_choose(sl);
+ router = routerlist_sl_choose_by_bandwidth(sl);
} else {
/* Either there are no pending connections, or no routers even seem to
* possibly support any of them. Choose a router at random. */
@@ -923,7 +923,7 @@ static routerinfo_t *choose_good_exit_server_general(routerlist_t *dir)
smartlist_subtract(sl,excludedexits);
if (options.StrictExitNodes || smartlist_overlap(sl,preferredexits))
smartlist_intersect(sl,preferredexits);
- router = smartlist_choose(sl);
+ router = routerlist_sl_choose_by_bandwidth(sl);
}
smartlist_free(preferredexits);
diff --git a/src/or/or.h b/src/or/or.h
index cc2457c688..5c2b153293 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1396,6 +1396,7 @@ int all_directory_servers_down(void);
struct smartlist_t;
void add_nickname_list_to_smartlist(struct smartlist_t *sl, const char *list);
int router_nickname_matches(routerinfo_t *router, const char *nickname);
+routerinfo_t *routerlist_sl_choose_by_bandwidth(smartlist_t *sl);
routerinfo_t *router_choose_random_node(char *preferred, char *excluded,
struct smartlist_t *excludedsmartlist,
int preferuptime, int preferbandwidth,
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index a8817e8767..2d081d387c 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -236,7 +236,7 @@ routerlist_sl_remove_unreliable_routers(smartlist_t *sl)
}
}
-static routerinfo_t *
+routerinfo_t *
routerlist_sl_choose_by_bandwidth(smartlist_t *sl)
{
int i;