]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Smaller RendPostPeriod on test networks
authorNick Mathewson <nickm@torproject.org>
Mon, 5 Jan 2015 01:10:53 +0000 (20:10 -0500)
committerteor <teor2345@gmail.com>
Sat, 10 Jan 2015 11:34:28 +0000 (22:34 +1100)
This patch makes the minimum 5 seconds, and the default 2 minutes.

Closes 13401.

changes/bug13401 [new file with mode: 0644]
src/or/config.c

diff --git a/changes/bug13401 b/changes/bug13401
new file mode 100644 (file)
index 0000000..44be085
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor features (testing networks):
+    - Drop the minimum RendPostPeriod on a testing network to 5 seconds,
+      and the default to 2 minutes. Closes ticket 13401.
+
index 2fa077e146f3a9d1c2c02128a49201b398f63fec..9a374847d7a148eed75a53b1374a80b782989633 100644 (file)
@@ -496,6 +496,7 @@ static const config_var_t testing_tor_network_defaults[] = {
   V(TestingEnableCellStatsEvent, BOOL,     "1"),
   V(TestingEnableTbEmptyEvent,   BOOL,     "1"),
   VAR("___UsingTestNetworkDefaults", BOOL, UsingTestNetworkDefaults_, "1"),
+  V(RendPostPeriod,              INTERVAL, "2 minutes"),
 
   { NULL, CONFIG_TYPE_OBSOLETE, 0, NULL }
 };
@@ -2492,6 +2493,7 @@ compute_publishserverdescriptor(or_options_t *options)
 /** Lowest allowable value for RendPostPeriod; if this is too low, hidden
  * services can overload the directory system. */
 #define MIN_REND_POST_PERIOD (10*60)
+#define MIN_REND_POST_PERIOD_TESTING (5)
 
 /** Higest allowable value for PredictedPortsRelevanceTime; if this is
  * too high, our selection of exits will decrease for an extended
@@ -2976,10 +2978,13 @@ options_validate(or_options_t *old_options, or_options_t *options,
     options->MinUptimeHidServDirectoryV2 = 0;
   }
 
-  if (options->RendPostPeriod < MIN_REND_POST_PERIOD) {
+  const int min_rendpostperiod =
+    options->TestingTorNetwork ?
+    MIN_REND_POST_PERIOD_TESTING : MIN_REND_POST_PERIOD;
+  if (options->RendPostPeriod < min_rendpostperiod) {
     log_warn(LD_CONFIG, "RendPostPeriod option is too short; "
-             "raising to %d seconds.", MIN_REND_POST_PERIOD);
-    options->RendPostPeriod = MIN_REND_POST_PERIOD;
+             "raising to %d seconds.", min_rendpostperiod);
+    options->RendPostPeriod = min_rendpostperiod;;
   }
 
   if (options->RendPostPeriod > MAX_DIR_PERIOD) {