From 0c5ca28a14766763e8a24eda9c30f5dd12b83f57 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 15 Nov 2016 11:27:00 -0500 Subject: [PATCH] fall back on regular tunnel algorithm --- TunnelPool.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/TunnelPool.cpp b/TunnelPool.cpp index e0a3e99e..0c3db211 100644 --- a/TunnelPool.cpp +++ b/TunnelPool.cpp @@ -176,6 +176,18 @@ namespace tunnel } 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; return tunnel; }