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

[or-cvs] r12896: new config option FetchDirInfoEarly for tup/ioerror and the (in tor/trunk: . contrib doc src/or)



Author: arma
Date: 2007-12-21 01:08:00 -0500 (Fri, 21 Dec 2007)
New Revision: 12896

Modified:
   tor/trunk/ChangeLog
   tor/trunk/contrib/exitlist
   tor/trunk/doc/tor.1.in
   tor/trunk/src/or/config.c
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/main.c
   tor/trunk/src/or/networkstatus.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/routerlist.c
Log:
new config option FetchDirInfoEarly for tup/ioerror and the tordnsel


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/ChangeLog	2007-12-21 06:08:00 UTC (rev 12896)
@@ -1,4 +1,4 @@
-Changes in version 0.2.0.13-alpha - 2007-12-??
+Changes in version 0.2.0.13-alpha - 2007-12-21
   o New directory authorities:
     - Set up lefkada (run by Geoff Goodell) as the fourth v3 directory
       authority.
@@ -18,8 +18,6 @@
     - Stop thinking that 0.1.2.x directory servers can handle "begin_dir"
       requests. Should ease bugs 406 and 419 where 0.1.2.x relays are
       crashing or mis-answering these requests.
-    - Stop being so aggressive about fetching v2 dir info if your
-      DirPort is on but your ORPort is off.
     - Relays were publishing their server descriptor to v1 and v2
       directory authorities, but they didn't try publishing to v3-only
       authorities. Fix this; and also stop publishing to v1 authorities.
@@ -47,6 +45,10 @@
       bridges they know. They provide router status summaries to the
       controller on "getinfo ns/purpose/bridge", and also dump summaries
       to a file periodically.
+    - Stop fetching directory info so aggressively if your DirPort is
+      on but your ORPort is off; stop fetching v2 dir info entirely.
+      You can override these choices with the new FetchDirInfoEarly
+      config option.
 
   o Minor bugfixes:
     - The fix in 0.2.0.12-alpha cleared the "hsdir" flag in v3 network

Modified: tor/trunk/contrib/exitlist
===================================================================
--- tor/trunk/contrib/exitlist	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/contrib/exitlist	2007-12-21 06:08:00 UTC (rev 12896)
@@ -17,7 +17,8 @@
     cat ~/.tor/cached-descriptors* | python exitlist 18.244.0.188:80
 
  You should look at the "FetchUselessDescriptors" config option in the
- man page.
+ man page. For 0.2.0.13-alpha and later, also look at the
+ "FetchDirInfoEarly" config option.
 
  Note that this script won't give you a perfect list of IP addresses
  that might connect to you using Tor, since some Tor servers might exit

Modified: tor/trunk/doc/tor.1.in
===================================================================
--- tor/trunk/doc/tor.1.in	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/doc/tor.1.in	2007-12-21 06:08:00 UTC (rev 12896)
@@ -211,6 +211,13 @@
 believe the same authorities they do.
 .LP
 .TP
+\fBFetchDirInfoEarly \fR\fB0\fR|\fB1\fR\fP
+If set to 1, Tor will always fetch directory information like other
+directory caches, even if you don't meet the normal criteria for
+fetching early. Normal users should leave it off.
+(Default: 0)
+.LP
+.TP
 \fBFetchHidServDescriptors \fR\fB0\fR|\fB1\fR\fP
 If set to 0, Tor will never fetch any hidden service descriptors from
 the rendezvous directories. This option is only useful if you're using

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/src/or/config.c	2007-12-21 06:08:00 UTC (rev 12896)
@@ -190,6 +190,7 @@
   V(FascistFirewall,             BOOL,     "0"),
   V(FirewallPorts,               CSV,      ""),
   V(FastFirstHopPK,              BOOL,     "1"),
+  V(FetchDirInfoEarly,           BOOL,     "0"),
   V(FetchServerDescriptors,      BOOL,     "1"),
   V(FetchHidServDescriptors,     BOOL,     "1"),
   V(FetchUselessDescriptors,     BOOL,     "0"),
@@ -1240,10 +1241,10 @@
   if (old_options) {
     if (authdir_mode_v3(options) && !authdir_mode_v3(old_options))
       dirvote_recalculate_timing(options, time(NULL));
-    if (!bool_eq(directory_fetches_dir_info_like_mirror(options),
-                 directory_fetches_dir_info_like_mirror(old_options)) ||
-        !bool_eq(directory_fetches_dir_info_like_bridge_user(options),
-                 directory_fetches_dir_info_like_bridge_user(old_options))) {
+    if (!bool_eq(directory_fetches_dir_info_early(options),
+                 directory_fetches_dir_info_early(old_options)) ||
+        !bool_eq(directory_fetches_dir_info_later(options),
+                 directory_fetches_dir_info_later(old_options))) {
       /* Make sure update_router_have_min_dir_info gets called. */
       router_dir_info_changed();
       /* We might need to download a new consensus status later or sooner than

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/src/or/dirserv.c	2007-12-21 06:08:00 UTC (rev 12896)
@@ -1114,7 +1114,8 @@
 int
 directory_fetches_from_authorities(or_options_t *options)
 {
-  /* XXX if options->FetchDirInfoEagerly, return 1 */
+  if (options->FetchDirInfoEarly)
+    return 1;
   if (options->DirPort == 0)
     return 0;
   if (options->BridgeRelay == 1)
@@ -1130,7 +1131,7 @@
  * on the "mirror" schedule rather than the "client" schedule.
  */
 int
-directory_fetches_dir_info_like_mirror(or_options_t *options)
+directory_fetches_dir_info_early(or_options_t *options)
 {
   return directory_fetches_from_authorities(options);
 }
@@ -1142,7 +1143,7 @@
  * client as a directory guard.
  */
 int
-directory_fetches_dir_info_like_bridge_user(or_options_t *options)
+directory_fetches_dir_info_later(or_options_t *options)
 {
   return options->UseBridges != 0;
 }

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/src/or/main.c	2007-12-21 06:08:00 UTC (rev 12896)
@@ -954,7 +954,7 @@
    * (if we've passed our internal checks). */
   if (time_to_fetch_directory < now) {
     /* Only caches actually need to fetch directories now. */
-    if (directory_fetches_dir_info_like_mirror(options) &&
+    if (directory_fetches_dir_info_early(options) &&
         !authdir_mode_v1(options)) {
       if (any_trusted_dir_is_v1_authority() &&
           !should_delay_dir_fetches(options))
@@ -967,7 +967,7 @@
   }
 
   /* Caches need to fetch running_routers; directory clients don't. */
-  if (directory_fetches_dir_info_like_mirror(options) &&
+  if (directory_fetches_dir_info_early(options) &&
       time_to_fetch_running_routers < now) {
     if (!authdir_mode_v1(options) && !should_delay_dir_fetches(options)) {
       directory_get_from_dirserver(DIR_PURPOSE_FETCH_RUNNING_LIST,

Modified: tor/trunk/src/or/networkstatus.c
===================================================================
--- tor/trunk/src/or/networkstatus.c	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/src/or/networkstatus.c	2007-12-21 06:08:00 UTC (rev 12896)
@@ -1063,7 +1063,7 @@
     long dl_interval;
     long interval = c->fresh_until - c->valid_after;
     time_t start;
-    if (directory_fetches_dir_info_like_mirror(options)) {
+    if (directory_fetches_dir_info_early(options)) {
       /* We want to cache the next one at some point after this one
        * is no longer fresh... */
       start = c->fresh_until + CONSENSUS_MIN_SECONDS_BEFORE_CACHING;
@@ -1078,7 +1078,7 @@
 
       /* If we're a bridge user, make use of the numbers we just computed
        * to choose the rest of the interval *after* them. */
-      if (directory_fetches_dir_info_like_bridge_user(options)) {
+      if (directory_fetches_dir_info_later(options)) {
         /* Give all the *clients* enough time to download the consensus. */
         start = start + dl_interval + CONSENSUS_MIN_SECONDS_BEFORE_CACHING;
         /* But try to get it before ours actually expires. */
@@ -1133,7 +1133,7 @@
   or_options_t *options = get_options();
   if (should_delay_dir_fetches(options))
     return;
-  if (directory_fetches_dir_info_like_mirror(options))
+  if (directory_fetches_dir_info_early(options))
     update_v2_networkstatus_cache_downloads(now);
   update_consensus_networkstatus_downloads(now);
   update_certificate_downloads(now);

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/src/or/or.h	2007-12-21 06:08:00 UTC (rev 12896)
@@ -2268,6 +2268,9 @@
   int RephistTrackTime; /**< How many seconds do we keep rephist info? */
   int FastFirstHopPK; /**< If Tor believes it is safe, should we save a third
                        * of our PK time by sending CREATE_FAST cells? */
+  /** Should we always fetch our dir info on the mirror schedule (which
+   * means directly from the authorities) no matter our other config? */
+  int FetchDirInfoEarly;
 
   addr_policy_t *reachable_addr_policy; /**< Parsed from ReachableAddresses */
 
@@ -3066,8 +3069,8 @@
                                      crypto_pk_env_t *private_key);
 
 int directory_fetches_from_authorities(or_options_t *options);
-int directory_fetches_dir_info_like_mirror(or_options_t *options);
-int directory_fetches_dir_info_like_bridge_user(or_options_t *options);
+int directory_fetches_dir_info_early(or_options_t *options);
+int directory_fetches_dir_info_later(or_options_t *options);
 int directory_caches_v2_dir_info(or_options_t *options);
 #define directory_caches_v1_dir_info(o) directory_caches_v2_dir_info(o)
 int directory_caches_dir_info(or_options_t *options);

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-12-21 05:54:35 UTC (rev 12895)
+++ tor/trunk/src/or/routerlist.c	2007-12-21 06:08:00 UTC (rev 12896)
@@ -3575,7 +3575,7 @@
   or_options_t *options = get_options();
 
   n_downloadable = smartlist_len(downloadable);
-  if (!directory_fetches_dir_info_like_mirror(options)) {
+  if (!directory_fetches_dir_info_early(options)) {
     if (n_downloadable >= MAX_DL_TO_DELAY) {
       log_debug(LD_DIR,
              "There are enough downloadable routerdescs to launch requests.");
@@ -3642,7 +3642,7 @@
   or_options_t *options = get_options();
   const smartlist_t *networkstatus_v2_list = networkstatus_get_v2_list();
 
-  if (! directory_fetches_dir_info_like_mirror(options)) {
+  if (! directory_fetches_dir_info_early(options)) {
     log_warn(LD_BUG, "Called update_router_descriptor_cache_downloads_v2() "
              "on a non-dir-mirror?");
   }
@@ -3877,7 +3877,7 @@
   or_options_t *options = get_options();
   if (should_delay_dir_fetches(options))
     return;
-  if (directory_fetches_dir_info_like_mirror(options)) {
+  if (directory_fetches_dir_info_early(options)) {
     update_router_descriptor_cache_downloads_v2(now);
   }
   update_consensus_router_descriptor_downloads(now);