[or-cvs] ok, ok, maybe *this* time my rep_hist_circbuilding_dormant(...
arma at seul.org
arma at seul.org
Thu Jun 8 22:36:15 UTC 2006
Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or
Modified Files:
or.h rephist.c routerlist.c
Log Message:
ok, ok, maybe *this* time my rep_hist_circbuilding_dormant() will work.
Index: or.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.836
retrieving revision 1.837
diff -u -p -d -r1.836 -r1.837
--- or.h 7 Jun 2006 09:18:53 -0000 1.836
+++ or.h 8 Jun 2006 22:36:13 -0000 1.837
@@ -2105,7 +2105,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 rep_hist_circbuilding_dormant(void);
+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.89
retrieving revision 1.90
diff -u -p -d -r1.89 -r1.90
--- rephist.c 8 Jun 2006 09:20:58 -0000 1.89
+++ rephist.c 8 Jun 2006 22:36:13 -0000 1.90
@@ -916,11 +916,12 @@ rep_hist_get_predicted_internal(time_t n
/** Return 1 if we have no need for circuits currently, else return 0. */
int
-rep_hist_circbuilding_dormant(void)
+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)
+ if (smartlist_len(predicted_ports_list) ||
+ predicted_internal_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now)
return 0;
/* see if we'll still need to build testing circuits */
Index: routerlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.516
retrieving revision 1.517
diff -u -p -d -r1.516 -r1.517
--- routerlist.c 4 Jun 2006 22:42:13 -0000 1.516
+++ routerlist.c 8 Jun 2006 22:36:13 -0000 1.517
@@ -3436,7 +3436,7 @@ update_router_descriptor_client_download
"Called router_descriptor_client_downloads() on a dir mirror?");
}
- if (rep_hist_circbuilding_dormant()) {
+ if (rep_hist_circbuilding_dormant(now)) {
log_info(LD_CIRC, "Skipping descriptor downloads: we haven't needed "
"any circuits lately.");
return;
More information about the tor-commits
mailing list