[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] when an OR starts up, it loads its directory from cache.



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

Modified Files:
	routerlist.c 
Log Message:
when an OR starts up, it loads its directory from cache.
then it serves *that directory* to others who ask for a copy of the
directory. it's better to serve no directory at all until you have a
fresh copy.


Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- routerlist.c	3 Oct 2004 02:37:51 -0000	1.145
+++ routerlist.c	6 Oct 2004 05:05:43 -0000	1.146
@@ -794,11 +794,11 @@
  * pkey; else check against the pkey of the signing directory server. */
 int router_load_routerlist_from_directory(const char *s,
                                           crypto_pk_env_t *pkey,
-                                          int check_version)
+                                          int dir_is_recent)
 {
   routerlist_t *new_list = NULL;
   if (router_parse_routerlist_from_directory(s, &new_list, pkey,
-                                             check_version)) {
+                                             dir_is_recent)) {
     log_fn(LOG_WARN, "Couldn't parse directory.");
     return -1;
   }
@@ -823,7 +823,8 @@
     dirserv_load_from_directory_string(s);
   } else {
     /* Remember the directory. */
-    dirserv_set_cached_directory(s, routerlist->published_on);
+    if(dir_is_recent)
+      dirserv_set_cached_directory(s, routerlist->published_on);
   }
   return 0;
 }