From ebe41535ba1620fef8dc4f55e68a62f6aafe8e8a Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 9 Feb 2018 22:40:29 +0100 Subject: [PATCH] Format --- dnscrypt-proxy/dnsutils.go | 10 +++++----- dnscrypt-proxy/plugin_cache.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dnscrypt-proxy/dnsutils.go b/dnscrypt-proxy/dnsutils.go index e49db335..5cedaf18 100644 --- a/dnscrypt-proxy/dnsutils.go +++ b/dnscrypt-proxy/dnsutils.go @@ -90,12 +90,12 @@ func setMaxTTL(msg *dns.Msg, ttl uint32) { } } for _, rr := range msg.Ns { - if ttl < rr.Header().Ttl { + if ttl < rr.Header().Ttl { rr.Header().Ttl = ttl } } for _, rr := range msg.Extra { - if ttl < rr.Header().Ttl { + if ttl < rr.Header().Ttl { rr.Header().Ttl = ttl } } @@ -106,12 +106,12 @@ func updateTTL(msg *dns.Msg, expiration time.Time) { ttl := uint32(time.Until(expiration) / time.Second) for _, rr := range msg.Answer { - rr.Header().Ttl = ttl + rr.Header().Ttl = ttl } for _, rr := range msg.Ns { - rr.Header().Ttl = ttl + rr.Header().Ttl = ttl } for _, rr := range msg.Extra { - rr.Header().Ttl = ttl + rr.Header().Ttl = ttl } } diff --git a/dnscrypt-proxy/plugin_cache.go b/dnscrypt-proxy/plugin_cache.go index 7f34b46d..3c4f6b58 100644 --- a/dnscrypt-proxy/plugin_cache.go +++ b/dnscrypt-proxy/plugin_cache.go @@ -70,8 +70,8 @@ func (plugin *PluginCacheResponse) Eval(pluginsState *PluginsState, msg *dns.Msg } } plugin.cachedResponses.cache.Add(cacheKey, cachedResponse) - updateTTL(msg, cachedResponse.expiration) + return nil }