mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 12:24:19 +00:00
fall back on regular tunnel algorithm
This commit is contained in:
parent
db63bb4495
commit
0c5ca28a14
@ -176,6 +176,18 @@ namespace tunnel
|
|||||||
}
|
}
|
||||||
if (i > ind && tunnel) break;
|
if (i > ind && tunnel) break;
|
||||||
}
|
}
|
||||||
|
if(HasLatencyRequirement() && !tunnel) {
|
||||||
|
ind = rand () % (tunnels.size ()/2 + 1), i = 0;
|
||||||
|
for (const auto& it: tunnels)
|
||||||
|
{
|
||||||
|
if (it->IsEstablished () && it != excluded)
|
||||||
|
{
|
||||||
|
tunnel = it;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (i > ind && tunnel) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!tunnel && excluded && excluded->IsEstablished ()) tunnel = excluded;
|
if (!tunnel && excluded && excluded->IsEstablished ()) tunnel = excluded;
|
||||||
return tunnel;
|
return tunnel;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user