aboutsummaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-05-30 06:19:06 +0000
committerRoger Dingledine <arma@torproject.org>2006-05-30 06:19:06 +0000
commitae2648fb1c1eed93a9cc2c7480c22516f1f33d56 (patch)
treeb400a035d775b179eba547fbaea9522cc9efb2e3 /src/or/rephist.c
parent1f0e20806b442153d439060b278a1da1b36d2216 (diff)
downloadtor-ae2648fb1c1eed93a9cc2c7480c22516f1f33d56.tar.gz
tor-ae2648fb1c1eed93a9cc2c7480c22516f1f33d56.zip
stop fetching descriptors if we're not a dir mirror and we
haven't tried to establish any circuits lately. svn:r6516
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 0790084597..d31161ca07 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -751,6 +751,8 @@ rep_hist_load_state(or_state_t *state, char **err)
return 0;
}
+/*********************************************************************/
+
/** A list of port numbers that have been used recently. */
static smartlist_t *predicted_ports_list=NULL;
/** The corresponding most recently used time for each port. */
@@ -912,6 +914,15 @@ rep_hist_get_predicted_internal(time_t now, int *need_uptime,
return 1;
}
+/** Return 1 if we have no need for circuits currently, else return 0. */
+int
+rep_hist_circbuilding_dormant(void)
+{
+ if (predicted_ports_list || predicted_internal_time)
+ return 0; /* nothing used lately. */
+ return 1;
+}
+
/** Free all storage held by the OR/link history caches, by the
* bandwidth history arrays, or by the port history. */
void