[or-cvs] tentative change: if you have your dirport set, you are a d...

arma at seul.org arma at seul.org
Tue May 30 06:11:38 UTC 2006


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

Modified Files:
	routerlist.c 
Log Message:
tentative change: if you have your dirport set, you are a directory
mirror, whether or not your orport is set.


Index: routerlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.512
retrieving revision 1.513
diff -u -p -d -r1.512 -r1.513
--- routerlist.c	26 May 2006 16:29:20 -0000	1.512
+++ routerlist.c	30 May 2006 06:11:36 -0000	1.513
@@ -1798,7 +1798,7 @@ routerlist_remove_old_routers(void)
 
   retain = digestmap_new();
   cutoff = now - OLD_ROUTER_DESC_MAX_AGE;
-  if (server_mode(options) && options->DirPort) {
+  if (options->DirPort) {
     SMARTLIST_FOREACH(networkstatus_list, networkstatus_t *, ns,
       {
         SMARTLIST_FOREACH(ns->entries, routerstatus_t *, rs,
@@ -2527,10 +2527,10 @@ void
 update_networkstatus_downloads(time_t now)
 {
   or_options_t *options = get_options();
-  if (server_mode(options) && options->DirPort)
-      update_networkstatus_cache_downloads(time(NULL));
-    else
-      update_networkstatus_client_downloads(time(NULL));
+  if (options->DirPort)
+    update_networkstatus_cache_downloads(time(NULL));
+  else
+    update_networkstatus_client_downloads(time(NULL));
 }
 
 /** Return 1 if all running sufficiently-stable routers will reject
@@ -3430,9 +3430,9 @@ update_router_descriptor_client_download
   int should_delay, n_downloadable;
   or_options_t *options = get_options();
 
-  if (server_mode(options) && options->DirPort) {
+  if (options->DirPort) {
     log_warn(LD_BUG,
-             "Called router_descriptor_client_downloads() on a mirror?");
+             "Called router_descriptor_client_downloads() on a dir mirror?");
   }
 
   /* XXX here's another magic 2 that probably should be replaced
@@ -3503,9 +3503,9 @@ update_router_descriptor_cache_downloads
   int n_download;
   or_options_t *options = get_options();
 
-  if (!(server_mode(options) && options->DirPort)) {
+  if (!options->DirPort) {
     log_warn(LD_BUG, "Called update_router_descriptor_cache_downloads() "
-             "on a non-mirror?");
+             "on a non-dir-mirror?");
   }
 
   if (!networkstatus_list || !smartlist_len(networkstatus_list))
@@ -3619,7 +3619,7 @@ void
 update_router_descriptor_downloads(time_t now)
 {
   or_options_t *options = get_options();
-  if (server_mode(options) && options->DirPort) {
+  if (options->DirPort) {
     update_router_descriptor_cache_downloads(now);
   } else {
     update_router_descriptor_client_downloads(now);



More information about the tor-commits mailing list