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

[or-cvs] don"t try to build circuits until we have 3 running servers;



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:
don't try to build circuits until we have 3 running servers;
and for networks that are very small, having more than a quarter
of the descriptors is much harder than having equal to or more than
a quarter of the descriptors -- follow the spec.


Index: routerlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.412
retrieving revision 1.413
diff -u -p -d -r1.412 -r1.413
--- routerlist.c	3 Jan 2006 10:42:20 -0000	1.412
+++ routerlist.c	3 Jan 2006 13:09:49 -0000	1.413
@@ -3487,7 +3487,7 @@ update_router_descriptor_downloads(time_
 int
 router_have_minimum_dir_info(void)
 {
-  int tot = 0, any_running = 0;
+  int tot = 0, num_running = 0;
   int n_ns, res, avg;
   static int have_enough = 0;
   if (!networkstatus_list || !routerlist) {
@@ -3504,12 +3504,10 @@ router_have_minimum_dir_info(void)
   avg = tot / n_ns;
   SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs,
      {
-       if (rs->status.is_running) {
-         any_running = 1;
-         break;
-       }
+       if (rs->status.is_running)
+         num_running++;
      });
-  res = smartlist_len(routerlist->routers) > (avg/4) && any_running;
+  res = smartlist_len(routerlist->routers) >= (avg/4) && num_running > 2;
  done:
   if (res && !have_enough) {
     log(LOG_NOTICE, LD_DIR,