]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Authoritative dirservers now also cache the directory, since
authorRoger Dingledine <arma@torproject.org>
Mon, 15 Nov 2004 09:38:17 +0000 (09:38 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 15 Nov 2004 09:38:17 +0000 (09:38 +0000)
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.

svn:r2891

src/or/dirserv.c
src/or/routerparse.c

index 39029293411468c53baef0a0a3a08475b642f0ef..f2946f9082e21fadf5e19106d0a98adfa7ed9c37 100644 (file)
@@ -713,7 +713,6 @@ void dirserv_set_cached_directory(const char *directory, time_t when,
 {
   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 1beb8d5997b5cb13fd0aee0e041a16c8ad2fdb03..5c2cd28f8298165f39811278114ce6a7aac4dfb8 100644 (file)
@@ -387,11 +387,9 @@ router_parse_routerlist_from_directory(const char *str,
      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 @@ router_parse_runningrouters(const char *str)
      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))) {