]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'maint-0.3.1' into maint-0.3.2
authorNick Mathewson <nickm@torproject.org>
Mon, 13 Nov 2017 17:27:36 +0000 (12:27 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 13 Nov 2017 17:27:36 +0000 (12:27 -0500)
1  2 
src/or/hs_common.c

index f79aeb598142330adc174254dc25676d9b0367af,7cef5a8e2c06f14c57587315af2460102ddaab0e..a0f2af29cd3c23a7a0ace3bb9b5a219662ce929b
@@@ -213,18 -56,7 +213,18 @@@ hs_check_service_private_dir(const cha
  STATIC uint64_t
  get_time_period_length(void)
  {
-   int32_t time_period_length = networkstatus_get_param(NULL, "hsdir-interval",
 +  /* If we are on a test network, make the time period smaller than normal so
 +     that we actually see it rotate. Specifically, make it the same length as
 +     an SRV protocol run. */
 +  if (get_options()->TestingTorNetwork) {
 +    unsigned run_duration = sr_state_get_protocol_run_duration();
 +    /* An SRV run should take more than a minute (it's 24 rounds) */
 +    tor_assert_nonfatal(run_duration > 60);
 +    /* Turn it from seconds to minutes before returning: */
 +    return sr_state_get_protocol_run_duration() / 60;
 +  }
 +
+   int32_t time_period_length = networkstatus_get_param(NULL, "hsdir_interval",
                                               HS_TIME_PERIOD_LENGTH_DEFAULT,
                                               HS_TIME_PERIOD_LENGTH_MIN,
                                               HS_TIME_PERIOD_LENGTH_MAX);