mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2024-12-28 00:20:13 +01:00
Round numbers
This commit is contained in:
parent
b63df9cdfa
commit
62e8d193c0
@ -179,11 +179,11 @@ func (serversInfo *ServersInfo) estimatorUpdate(candidate int) {
|
||||
if candidateRtt < currentBestRtt {
|
||||
serversInfo.inner[candidate], serversInfo.inner[0] = serversInfo.inner[0], serversInfo.inner[candidate]
|
||||
partialSort = true
|
||||
dlog.Debugf("New preferred candidate: %v (rtt: %v vs previous: %v)", serversInfo.inner[0].Name, candidateRtt, currentBestRtt)
|
||||
dlog.Debugf("New preferred candidate: %v (rtt: %d vs previous: %d)", serversInfo.inner[0].Name, int(candidateRtt), int(currentBestRtt))
|
||||
} else if candidateRtt > 0 && candidateRtt >= currentBestRtt*4.0 {
|
||||
if time.Since(serversInfo.inner[candidate].lastActionTS) > time.Duration(1*time.Minute) {
|
||||
serversInfo.inner[candidate].rtt.Add(MinF(MaxF(candidateRtt/2.0, currentBestRtt*2.0), candidateRtt))
|
||||
dlog.Debugf("Giving a new chance to candidate [%s], setting its RTT from %v to %v (best: %v)", serversInfo.inner[candidate].Name, candidateRtt, serversInfo.inner[candidate].rtt.Value(), currentBestRtt)
|
||||
dlog.Debugf("Giving a new chance to candidate [%s], setting its RTT from %d to %d (best: %d)", serversInfo.inner[candidate].Name, int(candidateRtt), int(serversInfo.inner[candidate].rtt.Value()), int(currentBestRtt))
|
||||
partialSort = true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user