Unconditionally use config CircuitBuildTimeout if LearnCircuitBuildTimeout is disabled

This commit is contained in:
Andrea Shepard 2012-06-12 12:11:32 -07:00 committed by Nick Mathewson
parent 5177ab9e47
commit 7df26de948

View File

@ -535,6 +535,12 @@ static double
circuit_build_times_get_initial_timeout(void)
{
double timeout;
/*
* Check if we have LearnCircuitBuildTimeout, and if we don't,
* always use CircuitBuildTimeout, no questions asked.
*/
if (get_options()->LearnCircuitBuildTimeout) {
if (!unit_tests && get_options()->CircuitBuildTimeout) {
timeout = get_options()->CircuitBuildTimeout*1000;
if (timeout < circuit_build_times_min_timeout()) {
@ -545,6 +551,11 @@ circuit_build_times_get_initial_timeout(void)
} else {
timeout = circuit_build_times_initial_timeout();
}
}
else {
timeout = get_options()->CircuitBuildTimeout*1000;
}
return timeout;
}