From 41db005d0b35daf9d60b669b35071a1e0f4a00fa Mon Sep 17 00:00:00 2001 From: epipho Date: Wed, 24 Jun 2015 18:58:45 -0400 Subject: [PATCH] Fix panic where r.Compress would be set before checking for errors. --- command/agent/dns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/agent/dns.go b/command/agent/dns.go index 66d595f311..32606abbad 100644 --- a/command/agent/dns.go +++ b/command/agent/dns.go @@ -787,8 +787,8 @@ func (d *DNSServer) handleRecurse(resp dns.ResponseWriter, req *dns.Msg) { var err error for _, recursor := range d.recursors { r, rtt, err = c.Exchange(req, recursor) - r.Compress = true if err == nil { + r.Compress = true // Forward the response d.logger.Printf("[DEBUG] dns: recurse RTT for %v (%v)", q, rtt) if err := resp.WriteMsg(r); err != nil {