mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-05 22:27:37 +03:00
Balance multiple stamps with the same name
This commit is contained in:
parent
16b2c84147
commit
a29b218b5c
1 changed files with 4 additions and 0 deletions
|
@ -297,6 +297,10 @@ func (proxy *Proxy) updateRegisteredServers() error {
|
||||||
len(registeredServers),
|
len(registeredServers),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
// Balance multiple stamps with the same name
|
||||||
|
rand.Shuffle(len(registeredServers), func(i, j int) {
|
||||||
|
registeredServers[i], registeredServers[j] = registeredServers[j], registeredServers[i]
|
||||||
|
})
|
||||||
for _, registeredServer := range registeredServers {
|
for _, registeredServer := range registeredServers {
|
||||||
if registeredServer.stamp.Proto != stamps.StampProtoTypeDNSCryptRelay &&
|
if registeredServer.stamp.Proto != stamps.StampProtoTypeDNSCryptRelay &&
|
||||||
registeredServer.stamp.Proto != stamps.StampProtoTypeODoHRelay {
|
registeredServer.stamp.Proto != stamps.StampProtoTypeODoHRelay {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue