mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-22 14:23:04 +01:00
Fix a magic number in get_max_sample_size
This commit is contained in:
parent
1e9cd5d2bb
commit
9d065ecc3d
1 changed files with 6 additions and 3 deletions
|
@ -898,14 +898,17 @@ get_max_sample_size(guard_selection_t *gs,
|
|||
int n_guards)
|
||||
{
|
||||
const int using_bridges = (gs->type == GS_TYPE_BRIDGE);
|
||||
const int min_sample = get_min_filtered_sample_size();
|
||||
|
||||
/* XXXX prop271 spec deviation with bridges, max_sample is "all of them" */
|
||||
if (using_bridges)
|
||||
return n_guards;
|
||||
else if (n_guards < 20) // XXXX prop271 spec deviation
|
||||
return n_guards;
|
||||
|
||||
const int max_sample = (int)(n_guards * get_max_sample_threshold());
|
||||
if (max_sample < min_sample) // XXXX prop271 spec deviation
|
||||
return min_sample;
|
||||
else
|
||||
return (int)(n_guards * get_max_sample_threshold());
|
||||
return max_sample;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue