mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-05 14:17:36 +03:00
Use SystemResolverTTL as a minimum timeout for cached resolver IPs
This commit is contained in:
parent
97e4c44223
commit
3db3de0a91
1 changed files with 2 additions and 2 deletions
|
@ -86,8 +86,8 @@ func ParseIP(ipStr string) net.IP {
|
||||||
func (xTransport *XTransport) saveCachedIP(host string, ip net.IP, ttl time.Duration) {
|
func (xTransport *XTransport) saveCachedIP(host string, ip net.IP, ttl time.Duration) {
|
||||||
item := &CachedIPItem{ip: ip, expiration: nil}
|
item := &CachedIPItem{ip: ip, expiration: nil}
|
||||||
if ttl >= 0 {
|
if ttl >= 0 {
|
||||||
if ttl < xTransport.timeout {
|
if ttl < SystemResolverTTL {
|
||||||
ttl = xTransport.timeout
|
ttl = SystemResolverTTL
|
||||||
}
|
}
|
||||||
expiration := time.Now().Add(ttl)
|
expiration := time.Now().Add(ttl)
|
||||||
item.expiration = &expiration
|
item.expiration = &expiration
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue