aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-05-11 15:49:00 -0400
committerNick Mathewson <nickm@torproject.org>2021-05-11 15:49:00 -0400
commit9d7fca2306dc09097a24e225de59fb1ade7c9e34 (patch)
tree33678652c43da5549179ec0e742d8ba585b7fd1d /src/app
parent2ae24d003d1d12e8e202748c4398d7438e4a65d9 (diff)
downloadtor-9d7fca2306dc09097a24e225de59fb1ade7c9e34.tar.gz
tor-9d7fca2306dc09097a24e225de59fb1ade7c9e34.zip
Make MinTimeToReportBandwidth a testing-only option (and rename it)
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c10
-rw-r--r--src/app/config/config.h7
-rw-r--r--src/app/config/or_options_st.h2
-rw-r--r--src/app/config/testnet.inc2
4 files changed, 4 insertions, 17 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 9011f36735..88da7a0aa7 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -563,7 +563,7 @@ static const config_var_t option_vars_[] = {
V(MaxUnparseableDescSizeToLog, MEMUNIT, "10 MB"),
VPORT(MetricsPort),
V(MetricsPortPolicy, LINELIST, NULL),
- V(MinTimeToReportBandwidth, INTERVAL, "1 day"),
+ V(TestingMinTimeToReportBandwidth, INTERVAL, "1 day"),
VAR("MyFamily", LINELIST, MyFamily_lines, NULL),
V(NewCircuitPeriod, INTERVAL, "30 seconds"),
OBSOLETE("NamingAuthoritativeDirectory"),
@@ -3712,13 +3712,6 @@ options_validate_cb(const void *old_options_, void *options_, char **msg)
options->HeartbeatPeriod = MIN_HEARTBEAT_PERIOD;
}
- if (options->MinTimeToReportBandwidth < MIN_MIN_TIME_TO_REPORT_BW &&
- !options->TestingTorNetwork) {
- log_warn(LD_CONFIG, "MinTimeToReportBandwidth is too short; "
- "raising to %d seconds.", MIN_MIN_TIME_TO_REPORT_BW);
- options->MinTimeToReportBandwidth = MIN_MIN_TIME_TO_REPORT_BW;
- }
-
if (options->KeepalivePeriod < 1)
REJECT("KeepalivePeriod option must be positive.");
@@ -3994,6 +3987,7 @@ options_validate_cb(const void *old_options_, void *options_, char **msg)
CHECK_DEFAULT(TestingSigningKeySlop);
CHECK_DEFAULT(TestingAuthKeySlop);
CHECK_DEFAULT(TestingLinkKeySlop);
+ CHECK_DEFAULT(TestingMinTimeToReportBandwidth);
or_options_free(dflt_options);
}
#undef CHECK_DEFAULT
diff --git a/src/app/config/config.h b/src/app/config/config.h
index 74e6942eb5..e95ef4a728 100644
--- a/src/app/config/config.h
+++ b/src/app/config/config.h
@@ -24,13 +24,6 @@
* expose more information than we're comfortable with. */
#define MIN_HEARTBEAT_PERIOD (30*60)
-/**
- * Lowest allowable value for MinTimeToReportBandwidth on a non-testing
- * network; if this is too low we might report detail that is too
- * fine-grained.
- **/
-#define MIN_MIN_TIME_TO_REPORT_BW (2*60*60)
-
/** Maximum default value for MaxMemInQueues, in bytes. */
#if SIZEOF_VOID_P >= 8
#define MAX_DEFAULT_MEMORY_QUEUE_SIZE (UINT64_C(8) << 30)
diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h
index efecc85d66..440c987365 100644
--- a/src/app/config/or_options_st.h
+++ b/src/app/config/or_options_st.h
@@ -1084,7 +1084,7 @@ struct or_options_t {
/** How far must we be into the current bandwidth-measurement period to
* report bandwidth observations from this period? */
- int MinTimeToReportBandwidth;
+ int TestingMinTimeToReportBandwidth;
/**
* Configuration objects for individual modules.
diff --git a/src/app/config/testnet.inc b/src/app/config/testnet.inc
index 527e0d00b1..039454a0d0 100644
--- a/src/app/config/testnet.inc
+++ b/src/app/config/testnet.inc
@@ -19,7 +19,7 @@
{ "TestingV3AuthInitialDistDelay", "20 seconds" },
{ "TestingAuthDirTimeToLearnReachability", "0 minutes" },
{ "MinUptimeHidServDirectoryV2", "0 minutes" },
-{ "MinTimeToReportBandwidth", "0 seconds" },
+{ "TestingMinTimeToReportBandwidth", "0 seconds" },
{ "TestingServerDownloadInitialDelay", "0" },
{ "TestingClientDownloadInitialDelay", "0" },
{ "TestingServerConsensusDownloadInitialDelay", "0" },