mirror of https://github.com/status-im/consul.git
Fix panic where r.Compress would be set before checking for errors.
This commit is contained in:
parent
d965e90306
commit
41db005d0b
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue