mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
Always weight routers by bandwidth.
Also always predict that we need a high capacity circuit or internal circuit.
This commit is contained in:
parent
5d4f5ef07d
commit
245be159af
@ -2133,6 +2133,8 @@ circuit_all_predicted_ports_handled(time_t now, int *need_uptime,
|
||||
smartlist_t *LongLivedServices = get_options()->LongLivedPorts;
|
||||
tor_assert(need_uptime);
|
||||
tor_assert(need_capacity);
|
||||
// Always predict need_capacity
|
||||
*need_capacity = 1;
|
||||
enough = (smartlist_len(sl) == 0);
|
||||
for (i = 0; i < smartlist_len(sl); ++i) {
|
||||
port = smartlist_get(sl, i);
|
||||
|
@ -1909,7 +1909,7 @@ rep_hist_get_predicted_internal(time_t now, int *need_uptime,
|
||||
return 0; /* too long ago */
|
||||
if (predicted_internal_uptime_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now)
|
||||
*need_uptime = 1;
|
||||
if (predicted_internal_capacity_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now)
|
||||
// Always predict that we need capacity.
|
||||
*need_capacity = 1;
|
||||
return 1;
|
||||
}
|
||||
|
@ -2070,10 +2070,8 @@ router_choose_random_node(smartlist_t *excludedsmartlist,
|
||||
if (excludedset)
|
||||
routerset_subtract_routers(sl,excludedset);
|
||||
|
||||
if (need_capacity || need_guard)
|
||||
// Always weight by bandwidth
|
||||
choice = routerlist_sl_choose_by_bandwidth(sl, rule);
|
||||
else
|
||||
choice = smartlist_choose(sl);
|
||||
|
||||
smartlist_free(sl);
|
||||
if (!choice && (need_uptime || need_capacity || need_guard)) {
|
||||
|
Loading…
Reference in New Issue
Block a user