diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-03-08 16:13:28 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-03-08 16:13:28 -0500 |
commit | 00446973f25227c0f805b7430e1ede6679e7ed16 (patch) | |
tree | 9dc00cf27b524a04e685a6e124373fa79497e88b /src/or | |
parent | dbd4a0175600833c7f84081deaa40fd6294ce1ce (diff) | |
parent | 5c7c5e593f7d898dd5260da32c1909508ddce40b (diff) | |
download | tor-00446973f25227c0f805b7430e1ede6679e7ed16.tar.gz tor-00446973f25227c0f805b7430e1ede6679e7ed16.zip |
Merge remote branch 'sebastian/bug2250' into maint-0.2.2
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 13 | ||||
-rw-r--r-- | src/or/or.h | 5 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/or/config.c b/src/or/config.c index 4d2c872459..d4be2072d8 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -393,6 +393,7 @@ static config_var_t _option_vars[] = { VAR("__HashedControlSessionPassword", LINELIST, HashedControlSessionPassword, NULL), V(MinUptimeHidServDirectoryV2, INTERVAL, "24 hours"), + V(_UsingTestNetworkDefaults, BOOL, "0"), { NULL, CONFIG_TYPE_OBSOLETE, 0, NULL } }; @@ -418,6 +419,7 @@ static config_var_t testing_tor_network_defaults[] = { V(TestingAuthDirTimeToLearnReachability, INTERVAL, "0 minutes"), V(TestingEstimatedDescriptorPropagationTime, INTERVAL, "0 minutes"), V(MinUptimeHidServDirectoryV2, INTERVAL, "0 minutes"), + V(_UsingTestNetworkDefaults, BOOL, "1"), { NULL, CONFIG_TYPE_OBSOLETE, 0, NULL } }; #undef VAR @@ -3655,7 +3657,7 @@ options_validate(or_options_t *old_options, or_options_t *options, /* Keep changes to hard-coded values synchronous to man page and default * values table. */ if (options->TestingV3AuthInitialVotingInterval != 30*60 && - !options->TestingTorNetwork) { + !options->TestingTorNetwork && !options->_UsingTestNetworkDefaults) { REJECT("TestingV3AuthInitialVotingInterval may only be changed in testing " "Tor networks!"); } else if (options->TestingV3AuthInitialVotingInterval < MIN_VOTE_INTERVAL) { @@ -3666,7 +3668,8 @@ options_validate(or_options_t *old_options, or_options_t *options, } if (options->TestingV3AuthInitialVoteDelay != 5*60 && - !options->TestingTorNetwork) { + !options->TestingTorNetwork && !options->_UsingTestNetworkDefaults) { + REJECT("TestingV3AuthInitialVoteDelay may only be changed in testing " "Tor networks!"); } else if (options->TestingV3AuthInitialVoteDelay < MIN_VOTE_SECONDS) { @@ -3674,7 +3677,7 @@ options_validate(or_options_t *old_options, or_options_t *options, } if (options->TestingV3AuthInitialDistDelay != 5*60 && - !options->TestingTorNetwork) { + !options->TestingTorNetwork && !options->_UsingTestNetworkDefaults) { REJECT("TestingV3AuthInitialDistDelay may only be changed in testing " "Tor networks!"); } else if (options->TestingV3AuthInitialDistDelay < MIN_DIST_SECONDS) { @@ -3689,7 +3692,7 @@ options_validate(or_options_t *old_options, or_options_t *options, } if (options->TestingAuthDirTimeToLearnReachability != 30*60 && - !options->TestingTorNetwork) { + !options->TestingTorNetwork && !options->_UsingTestNetworkDefaults) { REJECT("TestingAuthDirTimeToLearnReachability may only be changed in " "testing Tor networks!"); } else if (options->TestingAuthDirTimeToLearnReachability < 0) { @@ -3699,7 +3702,7 @@ options_validate(or_options_t *old_options, or_options_t *options, } if (options->TestingEstimatedDescriptorPropagationTime != 10*60 && - !options->TestingTorNetwork) { + !options->TestingTorNetwork && !options->_UsingTestNetworkDefaults) { REJECT("TestingEstimatedDescriptorPropagationTime may only be changed in " "testing Tor networks!"); } else if (options->TestingEstimatedDescriptorPropagationTime < 0) { diff --git a/src/or/or.h b/src/or/or.h index 74ff7436b1..3ce142556e 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2841,6 +2841,11 @@ typedef struct { */ double CircuitPriorityHalflife; + /** Set to true if the TestingTorNetwork configuration option is set. + * This is used so that options_validate() has a chance to realize that + * the defaults have changed. */ + int _UsingTestNetworkDefaults; + } or_options_t; /** Persistent state for an onion router, as saved to disk. */ |