[or-cvs] i lied, that won"t work at all. maybe this will.

arma at seul.org arma at seul.org
Sat Jul 22 07:15:36 UTC 2006


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

Modified Files:
	config.c main.c or.h rephist.c 
Log Message:
i lied, that won't work at all. maybe this will.


Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.574
retrieving revision 1.575
diff -u -p -d -r1.574 -r1.575
--- config.c	22 Jul 2006 05:29:31 -0000	1.574
+++ config.c	22 Jul 2006 07:15:34 -0000	1.575
@@ -796,8 +796,7 @@ options_act(or_options_t *old_options)
           return -1;
         }
         server_has_changed_ip();
-        if (has_completed_circuit ||
-            rep_hist_circbuilding_dormant(time(NULL)))
+        if (has_completed_circuit || any_predicted_circuits(time(NULL)))
           inform_testing_reachability();
       }
       cpuworkers_rotate();

Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.654
retrieving revision 1.655
diff -u -p -d -r1.654 -r1.655
--- main.c	22 Jul 2006 05:29:31 -0000	1.654
+++ main.c	22 Jul 2006 07:15:34 -0000	1.655
@@ -569,7 +569,7 @@ directory_info_has_arrived(time_t now, i
   }
 
   if (server_mode(options) && !we_are_hibernating() && !from_cache &&
-      (has_completed_circuit || rep_hist_circbuilding_dormant(now)))
+      (has_completed_circuit || any_predicted_circuits(now)))
     consider_testing_reachability();
 }
 
@@ -833,7 +833,7 @@ run_scheduled_events(time_t now)
     /* also, check religiously for reachability, if it's within the first
      * 20 minutes of our uptime. */
     if (server_mode(options) &&
-        (has_completed_circuit || rep_hist_circbuilding_dormant(now)) &&
+        (has_completed_circuit || any_predicted_circuits(now)) &&
         stats_n_seconds_working < TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT &&
         !we_are_hibernating())
       consider_testing_reachability();

Index: or.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.853
retrieving revision 1.854
diff -u -p -d -r1.853 -r1.854
--- or.h	18 Jul 2006 04:42:32 -0000	1.853
+++ or.h	22 Jul 2006 07:15:34 -0000	1.854
@@ -2141,6 +2141,7 @@ void rep_hist_note_used_internal(time_t 
 int rep_hist_get_predicted_internal(time_t now, int *need_uptime,
                                     int *need_capacity);
 
+int any_predicted_circuits(time_t now);
 int rep_hist_circbuilding_dormant(time_t now);
 
 void rep_hist_free_all(void);

Index: rephist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rephist.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -p -d -r1.91 -r1.92
--- rephist.c	17 Jul 2006 00:39:05 -0000	1.91
+++ rephist.c	22 Jul 2006 07:15:34 -0000	1.92
@@ -912,14 +912,20 @@ rep_hist_get_predicted_internal(time_t n
   return 1;
 }
 
+/** Any ports used lately? These are pre-seeded if we just started
+ * up or if we're running a hidden service. */
+int
+any_predicted_circuits(time_t now)
+{
+  return smartlist_len(predicted_ports_list) ||
+         predicted_internal_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now;
+}
+
 /** Return 1 if we have no need for circuits currently, else return 0. */
 int
 rep_hist_circbuilding_dormant(time_t now)
 {
-  /* Any ports used lately? These are pre-seeded if we just started
-   * up or if we're running a hidden service. */
-  if (smartlist_len(predicted_ports_list) ||
-      predicted_internal_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now)
+  if (any_predicted_circuits(now))
     return 0;
 
   /* see if we'll still need to build testing circuits */



More information about the tor-commits mailing list