mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 17:35:40 +08:00
dns: change non-expired ttl to 50years to avoid int overflow on 32bit os
This commit is contained in:
parent
c049b75b64
commit
6cdfbc3552
@ -5,8 +5,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// HundredYears is one hundred years duration in seconds, used for none-expired items
|
||||
const HundredYears = 100 * 365 * 24 * 3600
|
||||
// LongTTL is 50 years duration in seconds, used for none-expired items
|
||||
const LongTTL = 50 * 365 * 24 * 3600
|
||||
|
||||
type item struct {
|
||||
value []byte
|
||||
|
@ -218,7 +218,7 @@ func (c *Client) AddRecord(record string) error {
|
||||
binary.Write(&buf, binary.BigEndian, uint16(len(b)))
|
||||
buf.Write(b)
|
||||
|
||||
c.cache.Put(getKey(m.Question), buf.Bytes(), HundredYears)
|
||||
c.cache.Put(getKey(m.Question), buf.Bytes(), LongTTL)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user