[or-cvs] bugfix: we were ignoring the IS_FAST flag in the directory

arma at seul.org arma at seul.org
Mon Feb 13 00:09:33 UTC 2006


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

Modified Files:
	routerlist.c 
Log Message:
bugfix: we were ignoring the IS_FAST flag in the directory
status, meaning we were willing to pick trivial-bandwidth nodes
for "fast" connections.


Index: routerlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.443
retrieving revision 1.444
diff -u -p -d -r1.443 -r1.444
--- routerlist.c	12 Feb 2006 03:43:39 -0000	1.443
+++ routerlist.c	13 Feb 2006 00:09:30 -0000	1.444
@@ -726,15 +726,16 @@ router_is_unreliable(routerinfo_t *route
 /** Remove from routerlist <b>sl</b> all routers that are not
  * sufficiently stable. */
 static void
-routerlist_sl_remove_unreliable_routers(smartlist_t *sl,
-                                        int need_uptime, int need_guard)
+routerlist_sl_remove_unreliable_routers(smartlist_t *sl, int need_uptime,
+                                        int need_capacity, int need_guard)
 {
   int i;
   routerinfo_t *router;
 
   for (i = 0; i < smartlist_len(sl); ++i) {
     router = smartlist_get(sl, i);
-    if (router_is_unreliable(router, need_uptime, 0, need_guard)) {
+    if (router_is_unreliable(router, need_uptime,
+                             need_capacity, need_guard)) {
 //      log(LOG_DEBUG, "Router '%s' has insufficient uptime; deleting.",
  //         router->nickname);
       smartlist_del(sl, i--);
@@ -838,8 +839,8 @@ router_choose_random_node(const char *pr
     smartlist_subtract(sl,excludednodes);
     if (excludedsmartlist)
       smartlist_subtract(sl,excludedsmartlist);
-    if (need_uptime || need_guard)
-      routerlist_sl_remove_unreliable_routers(sl, need_uptime, need_guard);
+    routerlist_sl_remove_unreliable_routers(sl, need_uptime,
+                                            need_capacity, need_guard);
     if (need_capacity)
       choice = routerlist_sl_choose_by_bandwidth(sl);
     else



More information about the tor-commits mailing list