[tor-bugs] #6304 [Tor]: CircuitBuildTimeout default value does not match man page
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Mar 13 06:33:27 UTC 2013
#6304: CircuitBuildTimeout default value does not match man page
---------------------------------------------------+------------------------
Reporter: dcf | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: Tor: 0.2.4.x-final
Component: Tor | Version:
Keywords: documentation tor-client 023-backport | Parent:
Points: | Actualpoints:
---------------------------------------------------+------------------------
Comment(by dcf):
Replying to [comment:12 nickm]:
> Let's try this in 0.2.4 first. Can somebody review the code?
I looked at commit d13b996d and it doesn't immediately make sense to me. I
don't see why different conditions are used in different places.
Simplifying a bit,
{{{
if (get_options()->LearnCircuitBuildTimeout) {
if (get_options()->CircuitBuildTimeout)
timeout = get_options()->CircuitBuildTimeout*1000;
else
timeout = circuit_build_times_initial_timeout();
} else {
if (get_options()->CircuitBuildTimeout > 0)
timeout = get_options()->CircuitBuildTimeout*1000;
else
timeout = circuit_build_times_initial_timeout();
}
}}}
In the first branch of the `if` (`LearnCircuitBuildTimeout` is true), we
check `CircuitBuildTimeout != 0`. But in the second branch
(`LearnCircuitBuildTimeout` is false), we rather check
`CircuitBuildTimeout > 0`. I realize there must be ''some'' difference in
the two branches, or the outer `if` could disappear, but it's not obvious
to me why the conditions differ here. Can `CircuitBuildTimeout` be
negative (-1 means uninitialized or something)?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6304#comment:13>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list