diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-12-07 11:02:27 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-12-07 11:02:27 -0500 |
commit | 025dc19b63ce043d89e9f94743d0f74dd9d4e879 (patch) | |
tree | bd0c597935162dec673e842ae3ae8746591e6017 /src/or/dirserv.c | |
parent | f4f7e7a6f8a59fee532c5eca4cb71f2b28b5a1ad (diff) | |
parent | c35fad2bdef47f2063ccc989cac99b154e2ee36e (diff) | |
download | tor-025dc19b63ce043d89e9f94743d0f74dd9d4e879.tar.gz tor-025dc19b63ce043d89e9f94743d0f74dd9d4e879.zip |
Merge remote-tracking branch 'public/bug6887'
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index c1ddf73ee4..b35b71010c 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1147,6 +1147,8 @@ int dirserv_dump_directory_to_string(char **dir_out, crypto_pk_t *private_key) { + /* XXXX 024 Get rid of this function if we can confirm that nobody's + * fetching these any longer */ char *cp; char *identity_pkey; /* Identity key, DER64-encoded. */ char *recommended_versions; @@ -1447,21 +1449,12 @@ free_cached_dir_(void *_d) * If <b>is_running_routers</b>, this is really a v1 running_routers * document rather than a v1 directory. */ -void -dirserv_set_cached_directory(const char *directory, time_t published, - int is_running_routers) +static void +dirserv_set_cached_directory(const char *directory, time_t published) { - time_t now = time(NULL); - if (is_running_routers) { - if (published >= now - MAX_V1_RR_AGE) - set_cached_dir(&cached_runningrouters, tor_strdup(directory), published); - } else { - if (published >= now - MAX_V1_DIRECTORY_AGE) { - cached_dir_decref(cached_directory); - cached_directory = new_cached_dir(tor_strdup(directory), published); - } - } + cached_dir_decref(cached_directory); + cached_directory = new_cached_dir(tor_strdup(directory), published); } /** If <b>networkstatus</b> is non-NULL, we've just received a v2 @@ -1643,6 +1636,8 @@ dirserv_get_directory(void) static cached_dir_t * dirserv_regenerate_directory(void) { + /* XXXX 024 Get rid of this function if we can confirm that nobody's + * fetching these any longer */ char *new_directory=NULL; if (dirserv_dump_directory_to_string(&new_directory, @@ -1662,7 +1657,7 @@ dirserv_regenerate_directory(void) /* Save the directory to disk so we re-load it quickly on startup. */ - dirserv_set_cached_directory(the_directory->dir, time(NULL), 0); + dirserv_set_cached_directory(the_directory->dir, time(NULL)); return the_directory; } |