summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-10-28 18:37:52 +0000
committerNick Mathewson <nickm@torproject.org>2004-10-28 18:37:52 +0000
commit11d330be5e8c0cdb41784673699f18f9d206d4d4 (patch)
tree61b98bc262f16b20150305dc9d0ef75de25386b7 /src/or/dirserv.c
parent36bbab2f2bd8fe8902f4852c240a09de13419325 (diff)
downloadtor-11d330be5e8c0cdb41784673699f18f9d206d4d4.tar.gz
tor-11d330be5e8c0cdb41784673699f18f9d206d4d4.zip
Tweaks to prevent obsolete restarting tors from hammering the dirservers. (1) Cache a received directory as soon as the signature checks out. (2) Treat a cached directory as "recent" based on its mtime. (3) If we have a recent directory, we dont need to fetch a newer one for DirFetchPostPeriod. This needs review!
svn:r2618
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 551c17f9f0..56b2167d01 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -750,7 +750,6 @@ size_t dirserv_get_directory(const char **directory, int compress)
static int dirserv_regenerate_directory(void)
{
char *new_directory;
- char filename[512];
new_directory = tor_malloc(MAX_DIR_SIZE);
if (dirserv_dump_directory_to_string(new_directory, MAX_DIR_SIZE,
@@ -783,12 +782,6 @@ static int dirserv_regenerate_directory(void)
exit(0);
}
tor_free(new_directory);
- if(get_data_directory(&options)) {
- tor_snprintf(filename,sizeof(filename),"%s/cached-directory", get_data_directory(&options));
- if(write_str_to_file(filename,the_directory,0) < 0) {
- log_fn(LOG_WARN, "Couldn't write cached directory to disk. Ignoring.");
- }
- }
the_directory_is_dirty = 0;
return 0;