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

One Typo, One Bug



One typo (PublishServerDescriptor) and one 'bug'.

Clearing the state of trusted_dir_servers (particularly 
has_accepted_server_desc) every time any sort of option is applied throws out 
the accuracy of 'getinfo status/good-server-descriptor'. Patch clears the 
state of trusted_dirs only when it's empty or actually being set by the 
config.




Index: src/or/config.c
===================================================================
--- src/or/config.c     (revision 11994)
+++ src/or/config.c     (working copy)
@@ -477,7 +477,7 @@
     "and servers." },
   { "ORListenAddress", "Bind to this address to listen for connections from "
     "clients and servers, instead of the default 0.0.0.0:ORPort." },
-  { "PublishServerDescriptors", "Set to \"\" to keep the server from "
+  { "PublishServerDescriptor", "Set to \"\" to keep the server from "
     "uploading info to the directory authorities." },
   /*{ "RedirectExit", "When an outgoing connection tries to connect to a "
    *"given address, redirect it to another address instead." },
@@ -963,8 +963,8 @@
   int running_tor = options->command == CMD_RUN_TOR;
   char *msg;

-  clear_trusted_dir_servers();
   if (options->DirServers) {
+    clear_trusted_dir_servers();
     for (cl = options->DirServers; cl; cl = cl->next) {
       if (parse_dir_server_line(cl->value, 0)<0) {
         log_warn(LD_BUG,
@@ -973,7 +973,8 @@
       }
     }
   } else {
-    add_default_trusted_dirservers();
+    if (!router_get_trusted_dir_servers())
+      add_default_trusted_dirservers();
   }

   clear_bridge_list();

Attachment: signature.asc
Description: This is a digitally signed message part.