diff options
author | Roger Dingledine <arma@torproject.org> | 2004-08-18 06:10:12 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-08-18 06:10:12 +0000 |
commit | b294a037a451b097ebcf0c5ebb3c48daff1ff052 (patch) | |
tree | c656a34b90a8c43efb55196d4918fed409fb2f42 /src/or | |
parent | 6de61bd6946b2520e0668809b3aa0283191b8bd8 (diff) | |
download | tor-b294a037a451b097ebcf0c5ebb3c48daff1ff052.tar tor-b294a037a451b097ebcf0c5ebb3c48daff1ff052.tar.gz |
choose exit nodes by bandwidth too
svn:r2274
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/circuitbuild.c | 4 | ||||
-rw-r--r-- | src/or/or.h | 1 | ||||
-rw-r--r-- | src/or/routerlist.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 2dac67d81..a5863cce1 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 cc2457c68..5c2b15329 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 a8817e876..2d081d387 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; |