mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
Merge branch 'maint-0.3.3'
This commit is contained in:
commit
9f884a38e3
2 changed files with 17 additions and 4 deletions
6
changes/bug26121
Normal file
6
changes/bug26121
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
o Minor bugfixes (controller):
|
||||||
|
- Improve accuracy of the BUILDTIMEOUT_SET control port event's
|
||||||
|
TIMEOUT_RATE and CLOSE_RATE fields. (We were previously miscounting
|
||||||
|
the total number of circuits for these field values.) Fixes bug
|
||||||
|
26121; bugfix on 0.3.3.1-alpha.
|
||||||
|
|
|
@ -1910,13 +1910,20 @@ cbt_control_event_buildtimeout_set(const circuit_build_times_t *cbt,
|
||||||
|
|
||||||
/* The timeout rate is the ratio of the timeout count over
|
/* The timeout rate is the ratio of the timeout count over
|
||||||
* the total number of circuits attempted. The total number of
|
* the total number of circuits attempted. The total number of
|
||||||
* circuits is (timeouts+succeeded+closed), since a circuit can
|
* circuits is (timeouts+succeeded), since every circuit
|
||||||
* either timeout, close, or succeed. We cast the denominator
|
* either succeeds, or times out. "Closed" circuits are
|
||||||
|
* MEASURE_TIMEOUT circuits whose measurement period expired.
|
||||||
|
* All MEASURE_TIMEOUT circuits are counted in the timeouts stat
|
||||||
|
* before transitioning to MEASURE_TIMEOUT (in
|
||||||
|
* circuit_build_times_mark_circ_as_measurement_only()).
|
||||||
|
* MEASURE_TIMEOUT circuits that succeed are *not* counted as
|
||||||
|
* "succeeded". See circuit_build_times_handle_completed_hop().
|
||||||
|
*
|
||||||
|
* We cast the denominator
|
||||||
* to promote it to double before the addition, to avoid int32
|
* to promote it to double before the addition, to avoid int32
|
||||||
* overflow. */
|
* overflow. */
|
||||||
const double total_circuits =
|
const double total_circuits =
|
||||||
((double)cbt->num_circ_timeouts) + cbt->num_circ_succeeded
|
((double)cbt->num_circ_timeouts) + cbt->num_circ_succeeded;
|
||||||
+ cbt->num_circ_closed;
|
|
||||||
if (total_circuits >= 1.0) {
|
if (total_circuits >= 1.0) {
|
||||||
timeout_rate = cbt->num_circ_timeouts / total_circuits;
|
timeout_rate = cbt->num_circ_timeouts / total_circuits;
|
||||||
close_rate = cbt->num_circ_closed / total_circuits;
|
close_rate = cbt->num_circ_closed / total_circuits;
|
||||||
|
|
Loading…
Add table
Reference in a new issue