summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-10-06 09:04:11 +0000
committerRoger Dingledine <arma@torproject.org>2006-10-06 09:04:11 +0000
commit1d4bd3990fafc62ab52dc123923d6952dd160e98 (patch)
tree581202999220a9c6a0c1a4017593528daa451333
parentd1b9de222e14de3bc664f45cc9824b27a57f6d06 (diff)
downloadtor-1d4bd3990fafc62ab52dc123923d6952dd160e98.tar.gz
tor-1d4bd3990fafc62ab52dc123923d6952dd160e98.zip
fetch all the v1 directory stuff way less often. plus, move
around some housecleaning calls so they still occur often. are some of these redundant or in the wrong order? there are so many of them, maybe they should be put into a separate function that has better documentation. svn:r8607
-rw-r--r--src/or/main.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/or/main.c b/src/or/main.c
index fe14ab454a..f486745354 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -794,7 +794,7 @@ run_scheduled_events(time_t now)
accounting_run_housekeeping(now);
if (now % 10 == 0 && authdir_mode(options) && !we_are_hibernating()) {
- /* try to determine reachability */
+ /* try to determine reachability of the other Tor servers */
dirserv_test_reachability(0);
}
@@ -802,10 +802,6 @@ run_scheduled_events(time_t now)
* new running-routers list, and/or force-uploading our descriptor
* (if we've passed our internal checks). */
if (time_to_fetch_directory < now) {
- /* purge obsolete entries */
- routerlist_remove_old_routers();
- networkstatus_list_clean(now);
-
/* Only caches actually need to fetch directories now. */
if (options->DirPort && !options->V1AuthoritativeDir) {
/* XXX actually, we should only do this if we want to advertise
@@ -813,17 +809,8 @@ run_scheduled_events(time_t now)
if (any_trusted_dir_is_v1_authority())
directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR, NULL, 1);
}
-
-#define V1_DIR_FETCH_PERIOD (60*60)
+#define V1_DIR_FETCH_PERIOD (6*60*60)
time_to_fetch_directory = now + V1_DIR_FETCH_PERIOD;
-
- /* Also, take this chance to remove old information from rephist
- * and the rend cache. */
- rep_history_clean(now - options->RephistTrackTime);
- rend_cache_clean();
- /* And while we are at it, save the state with bandwidth history
- * and more. */
- or_state_save();
}
/* Caches need to fetch running_routers; directory clients don't. */
@@ -831,9 +818,17 @@ run_scheduled_events(time_t now)
if (!authdir_mode(options) || !options->V1AuthoritativeDir) {
directory_get_from_dirserver(DIR_PURPOSE_FETCH_RUNNING_LIST, NULL, 1);
}
-#define V1_RUNNINGROUTERS_FETCH_PERIOD (20*60)
+#define V1_RUNNINGROUTERS_FETCH_PERIOD (30*60)
time_to_fetch_running_routers = now + V1_RUNNINGROUTERS_FETCH_PERIOD;
- }
+
+ /* Also, take this chance to remove old information from rephist
+ * and the rend cache. */
+ rep_history_clean(now - options->RephistTrackTime);
+ rend_cache_clean();
+ /* And while we are at it, save the state with bandwidth history
+ * and more. */
+ or_state_save();
+ }
/* 2b. Once per minute, regenerate and upload the descriptor if the old
* one is inaccurate. */
@@ -857,6 +852,9 @@ run_scheduled_events(time_t now)
/* If any networkstatus documents are no longer recent, we need to
* update all the descriptors' running status. */
+ /* purge obsolete entries */
+ routerlist_remove_old_routers();
+ networkstatus_list_clean(now);
networkstatus_list_update_recent(now);
routers_update_all_from_networkstatus();