mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-04 13:47:39 +03:00
Properly round the TTL
This commit is contained in:
parent
5fedbe4c6e
commit
3bae61dbe1
1 changed files with 1 additions and 1 deletions
|
@ -196,7 +196,7 @@ func updateTTL(msg *dns.Msg, expiration time.Time) {
|
|||
ttl := uint32(0)
|
||||
if until > 0 {
|
||||
ttl = uint32(until / time.Second)
|
||||
if until-time.Duration(ttl)*time.Second < until/2 {
|
||||
if until-time.Duration(ttl)*time.Second >= time.Second/2 {
|
||||
ttl += 1
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue