Browse Source

fall back on regular tunnel algorithm

pull/709/head
Jeff Becker 8 years ago
parent
commit
0c5ca28a14
  1. 12
      TunnelPool.cpp

12
TunnelPool.cpp

@ -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…
Cancel
Save