[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] when using preferred entry or exit nodes, ignore whether



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

Modified Files:
	routerlist.c 
Log Message:
when using preferred entry or exit nodes, ignore whether
the circuit wants uptime or capacity. they asked for the
nodes, they get the nodes.


Index: routerlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.225
retrieving revision 1.226
diff -u -d -r1.225 -r1.226
--- routerlist.c	3 Apr 2005 05:53:34 -0000	1.225
+++ routerlist.c	6 Apr 2005 06:17:35 -0000	1.226
@@ -502,20 +502,25 @@
   excludednodes = smartlist_create();
   add_nickname_list_to_smartlist(excludednodes,excluded,0);
 
-  /* try the preferred nodes first */
+  /* Try the preferred nodes first. Ignore need_uptime and need_capacity,
+   * since the user explicitly asked for these nodes. */
   sl = smartlist_create();
   add_nickname_list_to_smartlist(sl,preferred,1);
   smartlist_subtract(sl,excludednodes);
   if (excludedsmartlist)
     smartlist_subtract(sl,excludedsmartlist);
+#if 0
   if (need_uptime)
     routerlist_sl_remove_unreliable_routers(sl);
   if (need_capacity)
     choice = routerlist_sl_choose_by_bandwidth(sl);
   else
-    choice = smartlist_choose(sl);
+#endif
+  choice = smartlist_choose(sl);
   smartlist_free(sl);
   if (!choice && !strict) {
+    /* Then give up on our preferred choices: any node
+     * will do that has the required attributes. */
     sl = smartlist_create();
     router_add_running_routers_to_smartlist(sl, allow_unverified,
                                             need_uptime, need_capacity);