mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 15:43:32 +01:00
Merge branch 'dont-require-bandwidthcapacity' into 'main'
In router_is_active, don't require non-zero bandwidthcapacity Closes #13000 and #40917 See merge request tpo/core/tor!801
This commit is contained in:
commit
d1e8c7a603
@ -112,8 +112,7 @@ dirserv_thinks_router_is_unreliable(time_t now,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Return 1 if <b>ri</b>'s descriptor is "active" -- running, valid,
|
/** Return 1 if <b>ri</b>'s descriptor is "active" -- running, valid,
|
||||||
* not hibernating, having observed bw greater 0, and not too old. Else
|
* not hibernating, and not too old. Else return 0.
|
||||||
* return 0.
|
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
router_is_active(const routerinfo_t *ri, const node_t *node, time_t now)
|
router_is_active(const routerinfo_t *ri, const node_t *node, time_t now)
|
||||||
@ -125,20 +124,6 @@ router_is_active(const routerinfo_t *ri, const node_t *node, time_t now)
|
|||||||
if (!node->is_running || !node->is_valid || ri->is_hibernating) {
|
if (!node->is_running || !node->is_valid || ri->is_hibernating) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Only require bandwidth capacity in non-test networks, or
|
|
||||||
* if TestingTorNetwork, and TestingMinExitFlagThreshold is non-zero */
|
|
||||||
if (!ri->bandwidthcapacity) {
|
|
||||||
if (get_options()->TestingTorNetwork) {
|
|
||||||
if (dirauth_get_options()->TestingMinExitFlagThreshold > 0) {
|
|
||||||
/* If we're in a TestingTorNetwork, and TestingMinExitFlagThreshold is,
|
|
||||||
* then require bandwidthcapacity */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* If we're not in a TestingTorNetwork, then require bandwidthcapacity */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user