mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-03 18:04:40 +01:00
updating_until -> updatingUntil
This commit is contained in:
parent
a4cbc66fdd
commit
3f3cd1e67d
1 changed files with 6 additions and 6 deletions
|
@ -40,9 +40,9 @@ const (
|
|||
)
|
||||
|
||||
type CachedIPItem struct {
|
||||
ip net.IP
|
||||
expiration *time.Time
|
||||
updating_until *time.Time
|
||||
ip net.IP
|
||||
expiration *time.Time
|
||||
updatingUntil *time.Time
|
||||
}
|
||||
|
||||
type CachedIPs struct {
|
||||
|
@ -106,7 +106,7 @@ func ParseIP(ipStr string) net.IP {
|
|||
// If ttl < 0, never expire
|
||||
// Otherwise, ttl is set to max(ttl, MinResolverIPTTL)
|
||||
func (xTransport *XTransport) saveCachedIP(host string, ip net.IP, ttl time.Duration) {
|
||||
item := &CachedIPItem{ip: ip, expiration: nil, updating_until: nil}
|
||||
item := &CachedIPItem{ip: ip, expiration: nil, updatingUntil: nil}
|
||||
if ttl >= 0 {
|
||||
if ttl < MinResolverIPTTL {
|
||||
ttl = MinResolverIPTTL
|
||||
|
@ -126,7 +126,7 @@ func (xTransport *XTransport) markUpdatingCachedIP(host string) {
|
|||
if ok {
|
||||
now := time.Now()
|
||||
until := now.Add(xTransport.timeout)
|
||||
item.updating_until = &until
|
||||
item.updatingUntil = &until
|
||||
xTransport.cachedIPs.cache[host] = item
|
||||
}
|
||||
xTransport.cachedIPs.Unlock()
|
||||
|
@ -144,7 +144,7 @@ func (xTransport *XTransport) loadCachedIP(host string) (ip net.IP, expired bool
|
|||
expiration := item.expiration
|
||||
if expiration != nil && time.Until(*expiration) < 0 {
|
||||
expired = true
|
||||
if item.updating_until != nil && time.Until(*item.updating_until) > 0 {
|
||||
if item.updatingUntil != nil && time.Until(*item.updatingUntil) > 0 {
|
||||
updating = true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue