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

[or-cvs] r12898: Directory authorities should only automatically download Ext (in tor/trunk: . src/or)



Author: arma
Date: 2007-12-21 01:33:02 -0500 (Fri, 21 Dec 2007)
New Revision: 12898

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/config.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/router.c
Log:
Directory authorities should only automatically download Extra Info
documents if they're v1, v2, or v3 authorities.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-12-21 06:28:59 UTC (rev 12897)
+++ tor/trunk/ChangeLog	2007-12-21 06:33:02 UTC (rev 12898)
@@ -95,6 +95,8 @@
     - Only Tors that want to mirror the v2 directory info should
       create the "cached-status" directory in their datadir. All Tors
       used to create it. Bugfix on 0.1.2.x.
+    - Directory authorities should only automatically download Extra Info
+      documents if they're v1, v2, or v3 authorities.
 
   o Minor features:
     - On USR1, when dmalloc is in use, log the top 10 memory

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2007-12-21 06:28:59 UTC (rev 12897)
+++ tor/trunk/src/or/config.c	2007-12-21 06:33:02 UTC (rev 12898)
@@ -2785,7 +2785,7 @@
                "UseEntryGuards. Disabling.");
       options->UseEntryGuards = 0;
     }
-    if (!options->DownloadExtraInfo) {
+    if (!options->DownloadExtraInfo && authdir_mode_any_main(options)) {
       log_info(LD_CONFIG, "Authoritative directories always try to download "
                "extra-info documents. Setting DownloadExtraInfo.");
       options->DownloadExtraInfo = 1;

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-12-21 06:28:59 UTC (rev 12897)
+++ tor/trunk/src/or/or.h	2007-12-21 06:33:02 UTC (rev 12898)
@@ -3732,11 +3732,13 @@
 int authdir_mode_v1(or_options_t *options);
 int authdir_mode_v2(or_options_t *options);
 int authdir_mode_v3(or_options_t *options);
+int authdir_mode_any_main(or_options_t *options);
+int authdir_mode_any_nonhidserv(or_options_t *options);
 int authdir_mode_handles_descs(or_options_t *options, int purpose);
 int authdir_mode_publishes_statuses(or_options_t *options);
 int authdir_mode_tests_reachability(or_options_t *options);
 int authdir_mode_bridge(or_options_t *options);
-int authdir_mode_any_nonhidserv(or_options_t *options);
+
 int clique_mode(or_options_t *options);
 int server_mode(or_options_t *options);
 int advertised_server_mode(void);

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2007-12-21 06:28:59 UTC (rev 12897)
+++ tor/trunk/src/or/router.c	2007-12-21 06:33:02 UTC (rev 12898)
@@ -823,7 +823,8 @@
 {
   return authdir_mode(options) && options->V3AuthoritativeDir != 0;
 }
-static int
+/** Return true iff we are a v1, v2, or v3 directory authority. */
+int
 authdir_mode_any_main(or_options_t *options)
 {
   return options->V1AuthoritativeDir ||