Skip to content

Commit a4684d3

Browse files
committed
Round TTLs
1 parent 34f0caa commit a4684d3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dnscrypt-proxy/dnsutils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ func updateTTL(msg *dns.Msg, expiration time.Time) {
196196
ttl := uint32(0)
197197
if until > 0 {
198198
ttl = uint32(until / time.Second)
199+
if until-time.Duration(ttl)*time.Second < until/2 {
200+
ttl += 1
201+
}
199202
}
200203
for _, rr := range msg.Answer {
201204
rr.Header().Ttl = ttl

0 commit comments

Comments
 (0)