Skip to content

Commit

Permalink
Fix panic where r.Compress would be set before checking for errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
MGPOwner authored and Alex Harford committed Jun 7, 2016
1 parent 382deb3 commit 41b6bce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion command/agent/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,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 {
Expand Down

0 comments on commit 41b6bce

Please sign in to comment.