[or-cvs] Authoritative dirservers now also cache the directory, since

Roger Dingledine arma at seul.org
Mon Nov 15 09:38:19 UTC 2004


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	dirserv.c routerparse.c 
Log Message:
Authoritative dirservers now also cache the directory, since
they weren't writing anything into their datadirectory, so
when they stop and start, they would know nothing until they
fetched a directory from another authdirserver.


Index: dirserv.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- dirserv.c	15 Nov 2004 04:04:20 -0000	1.119
+++ dirserv.c	15 Nov 2004 09:38:17 -0000	1.120
@@ -713,7 +713,6 @@
 {
   time_t now;
   cached_dir_t *d;
-  tor_assert(!get_options()->AuthoritativeDir);
   now = time(NULL);
   d = is_running_routers ? &cached_runningrouters : &cached_directory;
   if (when<=d->published) {

Index: routerparse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerparse.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- routerparse.c	15 Nov 2004 04:04:20 -0000	1.79
+++ routerparse.c	15 Nov 2004 09:38:17 -0000	1.80
@@ -387,11 +387,9 @@
      goto err;
   }
 
-  if(!get_options()->AuthoritativeDir) {
-    /* Now that we know the signature is okay, and we have a
-     * publication time, cache the directory. */
-    dirserv_set_cached_directory(str, published_on, 0);
-  }
+  /* Now that we know the signature is okay, and we have a
+   * publication time, cache the directory. */
+  dirserv_set_cached_directory(str, published_on, 0);
 
   if (!(tok = find_first_by_keyword(tokens, K_RECOMMENDED_SOFTWARE))) {
     log_fn(LOG_WARN, "Missing recommended-software line from directory.");
@@ -515,11 +513,9 @@
      goto err;
   }
 
-  if(!get_options()->AuthoritativeDir) {
-    /* Now that we know the signature is okay, and we have a
-     * publication time, cache the list. */
-    dirserv_set_cached_directory(str, published_on, 1);
-  }
+  /* Now that we know the signature is okay, and we have a
+   * publication time, cache the list. */
+  dirserv_set_cached_directory(str, published_on, 1);
 
   if (!(tok = find_first_by_keyword(tokens, K_ROUTER_STATUS))) {
     if (!(tok = find_first_by_keyword(tokens, K_RUNNING_ROUTERS))) {



More information about the tor-commits mailing list