[or-cvs] if our local cached directory is new enough, go ahead and
Roger Dingledine
arma at seul.org
Tue Sep 28 23:27:43 UTC 2004
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or
Modified Files:
dirserv.c or.h routerlist.c
Log Message:
if our local cached directory is new enough, go ahead and
start building circuits while we're fetching a new one
Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dirserv.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- dirserv.c 28 Sep 2004 22:38:21 -0000 1.84
+++ dirserv.c 28 Sep 2004 23:27:41 -0000 1.85
@@ -182,7 +182,7 @@
}
}
-/** 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)
Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.421
retrieving revision 1.422
diff -u -d -r1.421 -r1.422
--- or.h 28 Sep 2004 22:24:56 -0000 1.421
+++ or.h 28 Sep 2004 23:27:41 -0000 1.422
@@ -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)
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- routerlist.c 28 Sep 2004 22:49:34 -0000 1.142
+++ routerlist.c 28 Sep 2004 23:27:41 -0000 1.143
@@ -68,6 +68,10 @@
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);
}
}
More information about the tor-commits
mailing list