mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
don't fetch or cache running-routers files if there are no v1
authorities svn:r13398
This commit is contained in:
parent
ec6c131da6
commit
d1aafdc519
@ -961,26 +961,24 @@ run_scheduled_events(time_t now)
|
|||||||
* new running-routers list, and/or force-uploading our descriptor
|
* new running-routers list, and/or force-uploading our descriptor
|
||||||
* (if we've passed our internal checks). */
|
* (if we've passed our internal checks). */
|
||||||
if (time_to_fetch_directory < now) {
|
if (time_to_fetch_directory < now) {
|
||||||
/* Only caches actually need to fetch directories now. */
|
/* Only caches actually need to fetch v1 directories now. */
|
||||||
if (directory_fetches_dir_info_early(options) &&
|
if (directory_fetches_dir_info_early(options) &&
|
||||||
!authdir_mode_v1(options)) {
|
!authdir_mode_v1(options) && any_trusted_dir_is_v1_authority() &&
|
||||||
if (any_trusted_dir_is_v1_authority() &&
|
|
||||||
!should_delay_dir_fetches(options))
|
!should_delay_dir_fetches(options))
|
||||||
directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR,
|
directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR,
|
||||||
ROUTER_PURPOSE_GENERAL, NULL, 1);
|
ROUTER_PURPOSE_GENERAL, NULL, 1);
|
||||||
}
|
|
||||||
/** How often do we (as a cache) fetch a new V1 directory? */
|
/** How often do we (as a cache) fetch a new V1 directory? */
|
||||||
#define V1_DIR_FETCH_PERIOD (12*60*60)
|
#define V1_DIR_FETCH_PERIOD (12*60*60)
|
||||||
time_to_fetch_directory = now + V1_DIR_FETCH_PERIOD;
|
time_to_fetch_directory = now + V1_DIR_FETCH_PERIOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Caches need to fetch running_routers; directory clients don't. */
|
/* Caches need to fetch running_routers; directory clients don't. */
|
||||||
|
if (time_to_fetch_running_routers < now) {
|
||||||
if (directory_fetches_dir_info_early(options) &&
|
if (directory_fetches_dir_info_early(options) &&
|
||||||
time_to_fetch_running_routers < now) {
|
!authdir_mode_v1(options) && any_trusted_dir_is_v1_authority() &&
|
||||||
if (!authdir_mode_v1(options) && !should_delay_dir_fetches(options)) {
|
!should_delay_dir_fetches(options))
|
||||||
directory_get_from_dirserver(DIR_PURPOSE_FETCH_RUNNING_LIST,
|
directory_get_from_dirserver(DIR_PURPOSE_FETCH_RUNNING_LIST,
|
||||||
ROUTER_PURPOSE_GENERAL, NULL, 1);
|
ROUTER_PURPOSE_GENERAL, NULL, 1);
|
||||||
}
|
|
||||||
/** How often do we (as a cache) fetch a new V1 runningrouters document? */
|
/** How often do we (as a cache) fetch a new V1 runningrouters document? */
|
||||||
#define V1_RUNNINGROUTERS_FETCH_PERIOD (12*60*60)
|
#define V1_RUNNINGROUTERS_FETCH_PERIOD (12*60*60)
|
||||||
time_to_fetch_running_routers = now + V1_RUNNINGROUTERS_FETCH_PERIOD;
|
time_to_fetch_running_routers = now + V1_RUNNINGROUTERS_FETCH_PERIOD;
|
||||||
|
Loading…
Reference in New Issue
Block a user