mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
don't try to build circuits until we have 3 running servers;
and for networks that are very small, having more than a quarter of the descriptors is much harder than having equal to or more than a quarter of the descriptors -- follow the spec. svn:r5720
This commit is contained in:
parent
03017191dd
commit
da06f3553c
@ -3487,7 +3487,7 @@ update_router_descriptor_downloads(time_t now)
|
|||||||
int
|
int
|
||||||
router_have_minimum_dir_info(void)
|
router_have_minimum_dir_info(void)
|
||||||
{
|
{
|
||||||
int tot = 0, any_running = 0;
|
int tot = 0, num_running = 0;
|
||||||
int n_ns, res, avg;
|
int n_ns, res, avg;
|
||||||
static int have_enough = 0;
|
static int have_enough = 0;
|
||||||
if (!networkstatus_list || !routerlist) {
|
if (!networkstatus_list || !routerlist) {
|
||||||
@ -3504,12 +3504,10 @@ router_have_minimum_dir_info(void)
|
|||||||
avg = tot / n_ns;
|
avg = tot / n_ns;
|
||||||
SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs,
|
SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs,
|
||||||
{
|
{
|
||||||
if (rs->status.is_running) {
|
if (rs->status.is_running)
|
||||||
any_running = 1;
|
num_running++;
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
res = smartlist_len(routerlist->routers) > (avg/4) && any_running;
|
res = smartlist_len(routerlist->routers) >= (avg/4) && num_running > 2;
|
||||||
done:
|
done:
|
||||||
if (res && !have_enough) {
|
if (res && !have_enough) {
|
||||||
log(LOG_NOTICE, LD_DIR,
|
log(LOG_NOTICE, LD_DIR,
|
||||||
|
Loading…
Reference in New Issue
Block a user