diff options
author | Roger Dingledine <arma@torproject.org> | 2006-01-10 07:21:01 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-01-10 07:21:01 +0000 |
commit | c8e6003412300a235ae51d959d8a9bea63724a90 (patch) | |
tree | b83a0fdb682a19a03337ee28826b68d1d1e92c03 /src/or/main.c | |
parent | 43a4f8c7f301a9e83214b9cbff856b378edfe66b (diff) | |
download | tor-c8e6003412300a235ae51d959d8a9bea63724a90.tar.gz tor-c8e6003412300a235ae51d959d8a9bea63724a90.zip |
balance the reachability testing so a smidgen of it happens
every 10 seconds. this way we don't try to do 500 tls's at
once every 20 minutes.
svn:r5763
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/or/main.c b/src/or/main.c index 81e0770d6c..adddcbfb10 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -523,7 +523,7 @@ directory_all_unreachable(time_t now) } /** - * Return the interval to wait betweeen directory downloads, in seconds. + * Return the interval to wait between directory downloads, in seconds. */ static INLINE int get_dir_fetch_period(or_options_t *options) @@ -573,7 +573,7 @@ directory_info_has_arrived(time_t now, int from_cache) if (server_mode(options) && !we_are_hibernating()) { /* connect to the appropriate routers */ if (!authdir_mode(options)) - router_retry_connections(0); + router_retry_connections(0, 1); if (!from_cache) consider_testing_reachability(); } @@ -768,6 +768,11 @@ run_scheduled_events(time_t now) if (accounting_is_enabled(options)) accounting_run_housekeeping(now); + if (now % 10 == 0 && authdir_mode(options) && !we_are_hibernating()) { + /* try to determine reachability */ + router_retry_connections(1, 0); + } + /** 2. Periodically, we consider getting a new directory, getting a * new running-routers list, and/or force-uploading our descriptor * (if we've passed our internal checks). */ @@ -776,12 +781,6 @@ run_scheduled_events(time_t now) routerlist_remove_old_routers(); networkstatus_list_clean(now); - if (authdir_mode(options)) { - if (!we_are_hibernating()) { /* try to determine reachability */ - router_retry_connections(1); - } - } - /* Only caches actually need to fetch directories now. */ if (options->DirPort && !options->V1AuthoritativeDir) { directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR, NULL, 1); @@ -1108,7 +1107,7 @@ do_main_loop(void) if (authdir_mode(get_options())) { /* the directory is already here, run startup things */ - router_retry_connections(1); + router_retry_connections(1, 1); } if (server_mode(get_options())) { |