aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2014-07-24 14:31:49 +0300
committerNick Mathewson <nickm@torproject.org>2014-09-09 12:28:15 -0400
commit01800ea1e4e0312c8b204541a8e43d7aad67ad61 (patch)
tree83d81a65e11e78644055a0a39cdbd77ebe02bfd9 /src/or/dirserv.c
parent8e3939519999f73fadad1a8b8cff75aad0667312 (diff)
downloadtor-01800ea1e4e0312c8b204541a8e43d7aad67ad61.tar.gz
tor-01800ea1e4e0312c8b204541a8e43d7aad67ad61.zip
Add unittests for finding the third quartile of a set.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 1139dc1713..a5ad742b96 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1420,7 +1420,8 @@ dirserv_compute_performance_thresholds(routerlist_t *rl,
/* (Now bandwidths is sorted.) */
if (fast_bandwidth_kb < ROUTER_REQUIRED_MIN_BANDWIDTH/(2 * 1000))
fast_bandwidth_kb = bandwidths_kb[n_active/4];
- guard_bandwidth_including_exits_kb = bandwidths_kb[n_active*3/4];
+ guard_bandwidth_including_exits_kb =
+ third_quartile_uint32(bandwidths_kb, n_active);
guard_tk = find_nth_long(tks, n_active, n_active/8);
}