]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
choose exit nodes by bandwidth too
authorRoger Dingledine <arma@torproject.org>
Wed, 18 Aug 2004 06:10:12 +0000 (06:10 +0000)
committerRoger Dingledine <arma@torproject.org>
Wed, 18 Aug 2004 06:10:12 +0000 (06:10 +0000)
svn:r2274

src/or/circuitbuild.c
src/or/or.h
src/or/routerlist.c

index 2dac67d811b866c7505cc47f7273cd86ed51ba4e..a5863cce17921f712461768c19c83c89bda84b89 100644 (file)
@@ -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);
index cc2457c688242ac00c0bfe4ba172a2c8454fe933..5c2b15329314dafa192e727471a6d995a77af421 100644 (file)
@@ -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,
index a8817e8767ff31b40ef29f15fca12f99efea2e7c..2d081d387c4248cb475e05e8f9cf161457882028 100644 (file)
@@ -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;