From b9e89d2278ebd1b3892027d492c3b29be4724347 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 20 Jan 2018 01:00:19 +0100 Subject: [PATCH] megacheck --- dnscrypt-proxy/sources.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dnscrypt-proxy/sources.go b/dnscrypt-proxy/sources.go index ab68f545..1e5fba8d 100644 --- a/dnscrypt-proxy/sources.go +++ b/dnscrypt-proxy/sources.go @@ -23,8 +23,7 @@ const ( ) const ( - SourcesUpdateDelayAfterFailure = time.Duration(1) * time.Minute - SourcesUpdateDelay = time.Duration(24) * time.Hour + SourcesUpdateDelay = time.Duration(24) * time.Hour ) type Source struct { @@ -118,9 +117,13 @@ func NewSource(url string, minisignKeyStr string, cacheFile string, formatStr st urlsToPrefetch = append(urlsToPrefetch, URLToPrefetch{url: url, cacheFile: cacheFile, when: now.Add(delayTillNextUpdate)}) sigCacheFile := cacheFile + ".minisig" - sigStr, sigCached, sigDelayTillNextUpdate, err := fetchWithCache(sigURL, sigCacheFile) + sigStr, sigCached, sigDelayTillNextUpdate, sigErr := fetchWithCache(sigURL, sigCacheFile) urlsToPrefetch = append(urlsToPrefetch, URLToPrefetch{url: sigURL, cacheFile: sigCacheFile, when: now.Add(sigDelayTillNextUpdate)}) + if err != nil || sigErr != nil { + return source, urlsToPrefetch, nil + } + signature, err := minisign.DecodeSignature(sigStr) if err != nil { os.Remove(cacheFile)