mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Set default minimum bandwidth for exit flag to zero for TestingTorNetwork
This commit is contained in:
parent
8e29a7ae1d
commit
5c5198e713
@ -341,6 +341,7 @@ static config_var_t option_vars_[] = {
|
|||||||
V(PerConnBWRate, MEMUNIT, "0"),
|
V(PerConnBWRate, MEMUNIT, "0"),
|
||||||
V(PidFile, STRING, NULL),
|
V(PidFile, STRING, NULL),
|
||||||
V(TestingTorNetwork, BOOL, "0"),
|
V(TestingTorNetwork, BOOL, "0"),
|
||||||
|
V(TestingMinExitFlagThreshold, MEMUNIT, "0"),
|
||||||
V(TestingMinFastFlagThreshold, MEMUNIT, "0"),
|
V(TestingMinFastFlagThreshold, MEMUNIT, "0"),
|
||||||
V(OptimisticData, AUTOBOOL, "auto"),
|
V(OptimisticData, AUTOBOOL, "auto"),
|
||||||
V(PortForwarding, BOOL, "0"),
|
V(PortForwarding, BOOL, "0"),
|
||||||
|
@ -1894,11 +1894,17 @@ router_counts_toward_thresholds(const node_t *node, time_t now,
|
|||||||
/* Have measured bw? */
|
/* Have measured bw? */
|
||||||
int have_mbw =
|
int have_mbw =
|
||||||
dirserv_has_measured_bw(node->ri->cache_info.identity_digest);
|
dirserv_has_measured_bw(node->ri->cache_info.identity_digest);
|
||||||
|
uint64_t min_bw = ABSOLUTE_MIN_BW_VALUE_TO_CONSIDER;
|
||||||
|
const or_options_t *options = get_options();
|
||||||
|
|
||||||
|
if (options->TestingTorNetwork) {
|
||||||
|
min_bw = (int64_t)options->TestingMinExitFlagThreshold;
|
||||||
|
}
|
||||||
|
|
||||||
return node->ri && router_is_active(node->ri, node, now) &&
|
return node->ri && router_is_active(node->ri, node, now) &&
|
||||||
!digestmap_get(omit_as_sybil, node->ri->cache_info.identity_digest) &&
|
!digestmap_get(omit_as_sybil, node->ri->cache_info.identity_digest) &&
|
||||||
(dirserv_get_credible_bandwidth(node->ri) >=
|
(dirserv_get_credible_bandwidth(node->ri) >= min_bw) &&
|
||||||
ABSOLUTE_MIN_BW_VALUE_TO_CONSIDER) && (have_mbw || !require_mbw);
|
(have_mbw || !require_mbw);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Look through the routerlist, the Mean Time Between Failure history, and
|
/** Look through the routerlist, the Mean Time Between Failure history, and
|
||||||
|
@ -3910,6 +3910,9 @@ typedef struct {
|
|||||||
* of certain configuration options. */
|
* of certain configuration options. */
|
||||||
int TestingTorNetwork;
|
int TestingTorNetwork;
|
||||||
|
|
||||||
|
/** Minimum value for the Exit flag threshold on testing networks. */
|
||||||
|
uint64_t TestingMinExitFlagThreshold;
|
||||||
|
|
||||||
/** Minimum value for the Fast flag threshold on testing networks. */
|
/** Minimum value for the Fast flag threshold on testing networks. */
|
||||||
uint64_t TestingMinFastFlagThreshold;
|
uint64_t TestingMinFastFlagThreshold;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user