summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-09-18 15:30:27 -0400
committerNick Mathewson <nickm@torproject.org>2012-09-18 15:30:27 -0400
commitc35fad2bdef47f2063ccc989cac99b154e2ee36e (patch)
treeb263a0512114239c6615d79914ba1379b3482327 /src/or/dirserv.c
parent5dfec9f8335d0fa954ff5423a41e3e249547fd8d (diff)
downloadtor-c35fad2bdef47f2063ccc989cac99b154e2ee36e.tar.gz
tor-c35fad2bdef47f2063ccc989cac99b154e2ee36e.zip
Remove some deadcode for parsing v1 directories
Fixes bug 6887. There are opportunities to remove more functions if authorities can stop serving dummy v1 directory documents
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 468515eb22..3971594589 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1141,6 +1141,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;
@@ -1441,21 +1443,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
@@ -1637,6 +1630,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,
@@ -1656,7 +1651,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;
}