aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/or/config.c11
-rw-r--r--src/or/networkstatus.c3
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/routerlist.c1
5 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 47d3022fa..c9cf60590 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,8 @@ Changes in version 0.2.0.9-alpha - 2007-10-??
- Allow tor-gencert to generate a new certificate without replacing the
signing key.
- Allow certificates to include an address.
+ - When we change our directory-cache settings, reschedule all voting
+ and download operations.
o Minor features (router descriptor cache):
- If we find a cached-routers file that's been sitting around for more
diff --git a/src/or/config.c b/src/or/config.c
index 338f53875..eb2f50bd0 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1119,6 +1119,17 @@ options_act(or_options_t *old_options)
options_transition_affects_descriptor(old_options, options))
mark_my_descriptor_dirty();
+ /* We may need to reschedule some directory stuff if our status changed. */
+ if (authdir_mode_v3(options) && !authdir_mode_v3(old_options))
+ dirvote_recalculate_timing(options, time(NULL));
+ if (!bool_eq(dirserver_mode(options), dirserver_mode(old_options))) {
+ /* Make sure update_router_have_min_dir_info gets called. */
+ router_dir_info_changed();
+ /* We might need to download a new consensus status later or sooner than
+ * we had expected. */
+ update_consensus_networkstatus_fetch_time(time(NULL));
+ }
+
return 0;
}
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index aa70c2703..589633c97 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -776,11 +776,10 @@ networkstatus_consensus_download_failed(int status_code)
/** Update the time at which we'll consider replacing the current
* consensus. */
-static void
+void
update_consensus_networkstatus_fetch_time(time_t now)
{
or_options_t *options = get_options();
- /* XXXX020 call this when DirPort switches on or off. NMNM */
networkstatus_vote_t *c = networkstatus_get_live_consensus(now);
if (c) {
long dl_interval;
diff --git a/src/or/or.h b/src/or/or.h
index 53d1b6b24..5e7d582eb 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3103,6 +3103,7 @@ routerstatus_t *router_get_consensus_status_by_nickname(const char *nickname,
const char *networkstatus_get_router_digest_by_nickname(const char *nickname);
int networkstatus_nickname_is_unnamed(const char *nickname);
void networkstatus_consensus_download_failed(int status_code);
+void update_consensus_networkstatus_fetch_time(time_t now);
int should_delay_dir_fetches(or_options_t *options);
void update_networkstatus_downloads(time_t now);
networkstatus_v2_t *networkstatus_v2_get_by_digest(const char *digest);
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 6aa0e5880..b62a48f04 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3863,7 +3863,6 @@ router_dir_info_changed(void)
static void
update_router_have_minimum_dir_info(void)
{
- /*XXX020 call when dirserver_mode() changes. */
int num_present = 0, num_usable=0;
time_t now = time(NULL);
int res;