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

[tor-commits] [tor/release-0.2.4] Let testing networks override ABSOLUTE_MIN_VALUE_FOR_FAST_FLAG



commit a660fe6fd51cd511cdc610e4a50f06d59cbf74aa
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Mar 20 13:34:57 2013 -0400

    Let testing networks override ABSOLUTE_MIN_VALUE_FOR_FAST_FLAG
    
    This adds a new option to fix bug 8508 which broke chutney
    networks. The bug was introduced by 317d16de.
---
 changes/bug8408  |    4 ++++
 doc/tor.1.txt    |    5 +++++
 src/or/config.c  |    1 +
 src/or/dirserv.c |    3 +++
 src/or/or.h      |    3 +++
 5 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/changes/bug8408 b/changes/bug8408
new file mode 100644
index 0000000..ae9cf17
--- /dev/null
+++ b/changes/bug8408
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Allow TestingTorNetworks to override the 4096-byte minimum for the Fast
+      threshold. Otherwise they can't bootstrap until they've observed more
+      traffic. Fixes bug 8508; bugfix on 0.2.4.10-alpha.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 3be90be..5727ec3 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -2019,6 +2019,11 @@ The following options are used for running a testing Tor network.
     time. Changing this requires that **TestingTorNetwork** is set. (Default:
     10 minutes)
 
+**TestingMinFastFlagThreshold** __N__ **bytes**|**KBytes**|**MBytes**|**GBytes**::
+    Minimum value for the Fast flag.  Overrides the ordinary minimum taken
+    from the consensus when TestingTorNetwork is set. (Default: 0.)
+
+
 SIGNALS
 -------
 
diff --git a/src/or/config.c b/src/or/config.c
index 2b8eab7..9e2230e 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -341,6 +341,7 @@ static config_var_t option_vars_[] = {
   V(PerConnBWRate,               MEMUNIT,  "0"),
   V(PidFile,                     STRING,   NULL),
   V(TestingTorNetwork,           BOOL,     "0"),
+  V(TestingMinFastFlagThreshold, MEMUNIT,  "0"),
   V(OptimisticData,              AUTOBOOL, "auto"),
   V(PortForwarding,              BOOL,     "0"),
   V(PortForwardingHelper,        FILENAME, "tor-fw-helper"),
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 8e8f79a..81f328a 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2005,6 +2005,9 @@ dirserv_compute_performance_thresholds(routerlist_t *rl,
       ABSOLUTE_MIN_VALUE_FOR_FAST_FLAG,
       ABSOLUTE_MIN_VALUE_FOR_FAST_FLAG,
       INT32_MAX);
+    if (options->TestingTorNetwork) {
+      min_fast = (int32_t)options->TestingMinFastFlagThreshold;
+    }
     max_fast = networkstatus_get_param(NULL, "FastFlagMaxThreshold",
                                        INT32_MAX, min_fast, INT32_MAX);
     if (fast_bandwidth < (uint32_t)min_fast)
diff --git a/src/or/or.h b/src/or/or.h
index 6731552..2b0102d 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3910,6 +3910,9 @@ typedef struct {
    * of certain configuration options. */
   int TestingTorNetwork;
 
+  /** Minimum value for the Fast flag threshold on testing networks. */
+  uint64_t TestingMinFastFlagThreshold;
+
   /** If true, and we have GeoIP data, and we're a bridge, keep a per-country
    * count of how many client addresses have contacted us so that we can help
    * the bridge authority guess which countries have blocked access to us. */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits