From 16b2c84147737315ae6a82bb62c3e4a89cd701a2 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 24 Jun 2023 22:23:30 +0200 Subject: [PATCH] Tone down some errors --- dnscrypt-proxy/main.go | 6 +++--- dnscrypt-proxy/serversInfo.go | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/dnscrypt-proxy/main.go b/dnscrypt-proxy/main.go index ef8c2bd5..1ed3c097 100644 --- a/dnscrypt-proxy/main.go +++ b/dnscrypt-proxy/main.go @@ -30,7 +30,7 @@ func main() { tzErr := TimezoneSetup() dlog.Init("dnscrypt-proxy", dlog.SeverityNotice, "DAEMON") if tzErr != nil { - dlog.Errorf("Timezone setup failed: %v", tzErr) + dlog.Warnf("Timezone setup failed: [%v]", tzErr) } runtime.MemProfileRate = 0 @@ -129,7 +129,7 @@ func (app *App) AppMain() { dlog.Fatal(err) } if err := PidFileCreate(); err != nil { - dlog.Criticalf("Unable to create the PID file: %v", err) + dlog.Errorf("Unable to create the PID file: [%v]", err) } if err := app.proxy.InitPluginsGlobals(); err != nil { dlog.Fatal(err) @@ -145,7 +145,7 @@ func (app *App) AppMain() { func (app *App) Stop(service service.Service) error { if err := PidFileRemove(); err != nil { - dlog.Warnf("Failed to remove the PID file: %v", err) + dlog.Warnf("Failed to remove the PID file: [%v]", err) } dlog.Notice("Stopped.") return nil diff --git a/dnscrypt-proxy/serversInfo.go b/dnscrypt-proxy/serversInfo.go index 503d4330..fa6d99fa 100644 --- a/dnscrypt-proxy/serversInfo.go +++ b/dnscrypt-proxy/serversInfo.go @@ -615,9 +615,7 @@ func dohTestPacket(msgID uint16) []byte { msg.SetEdns0(uint16(MaxDNSPacketSize), false) ext := new(dns.EDNS0_PADDING) ext.Padding = make([]byte, 16) - if _, err := crypto_rand.Read(ext.Padding); err != nil { - dlog.Fatal(err) - } + _, _ = crypto_rand.Read(ext.Padding) edns0 := msg.IsEdns0() edns0.Option = append(edns0.Option, ext) body, err := msg.Pack() @@ -640,9 +638,7 @@ func dohNXTestPacket(msgID uint16) []byte { msg.SetEdns0(uint16(MaxDNSPacketSize), false) ext := new(dns.EDNS0_PADDING) ext.Padding = make([]byte, 16) - if _, err := crypto_rand.Read(ext.Padding); err != nil { - dlog.Fatal(err) - } + _, _ = crypto_rand.Read(ext.Padding) edns0 := msg.IsEdns0() edns0.Option = append(edns0.Option, ext) body, err := msg.Pack()