Browse Source

if our local cached directory is new enough, go ahead and
start building circuits while we're fetching a new one


svn:r2394

Roger Dingledine 21 years ago
parent
commit
a31ba30ae6
3 changed files with 7 additions and 2 deletions
  1. 1 1
      src/or/dirserv.c
  2. 2 1
      src/or/or.h
  3. 4 0
      src/or/routerlist.c

+ 1 - 1
src/or/dirserv.c

@@ -182,7 +182,7 @@ dirserv_router_fingerprint_is_known(const routerinfo_t *router)
   }
 }
 
-/** If we are an authoritative directory, and the list of approved
+/** If we are an authoritative dirserver, and the list of approved
  * servers contains one whose identity key digest is <b>digest</b>,
  * return that router's nickname.  Otherwise return NULL. */
 const char *dirserv_get_nickname_by_digest(const char *digest)

+ 2 - 1
src/or/or.h

@@ -136,7 +136,8 @@
 #endif
 
 /** How often do we rotate onion keys? */
-#define MIN_ONION_KEY_LIFETIME (12*60*60)
+#define OLD_MIN_ONION_KEY_LIFETIME (12*60*60) /* twice a day */
+#define MIN_ONION_KEY_LIFETIME (7*24*60*60) /* once a week */
 /** How often do we rotate TLS contexts? */
 #define MAX_SSL_KEY_LIFETIME (120*60)
 

+ 4 - 0
src/or/routerlist.c

@@ -68,6 +68,10 @@ int router_reload_router_list(void)
       if (router_load_routerlist_from_directory(s, NULL) < 0) {
         log_fn(LOG_WARN, "Cached directory '%s' was unparseable; ignoring.", filename);
       }
+      if(routerlist->published_on > time(NULL) - OLD_MIN_ONION_KEY_LIFETIME/2) {
+        /* XXX use new onion key lifetime when 0.0.8 servers are obsolete */
+        directory_has_arrived(); /* do things we've been waiting to do */
+      }
       tor_free(s);
     }
   }