Commit 8c080d71 authored by Georg Koppen's avatar Georg Koppen
Browse files

Merge remote-tracking branch 'isis/bug18113'

parents e18194b1 8869cf4f
......@@ -246,6 +246,19 @@ let TorLauncherUtil = // Public
} catch (e) {}
},
// Currently, this returns a random permutation of an array, bridgeArray.
// Later, we might want to change this function to weight based on the
// bridges' bandwidths.
rearrangeBridges: function(bridgeArray)
{
for (var j, x, i = bridgeArray.length; i;
j = parseInt(Math.random() * i),
x = bridgeArray[--i],
bridgeArray[i] = bridgeArray[j],
bridgeArray[j] = x);
return bridgeArray;
},
get shouldStartAndOwnTor()
{
const kPrefStartTor = "extensions.torlauncher.start_tor";
......@@ -361,6 +374,7 @@ let TorLauncherUtil = // Public
bridgeArray.push(s);
}
}
this.rearrangeBridges(bridgeArray);
return bridgeArray;
} catch(e) {};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment