mirror of
https://github.com/status-im/consul.git
synced 2025-02-16 15:47:21 +00:00
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
|
var err error
|
||||||
for _, recursor := range d.recursors {
|
for _, recursor := range d.recursors {
|
||||||
r, rtt, err = c.Exchange(req, recursor)
|
r, rtt, err = c.Exchange(req, recursor)
|
||||||
r.Compress = true
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
r.Compress = true
|
||||||
// Forward the response
|
// Forward the response
|
||||||
d.logger.Printf("[DEBUG] dns: recurse RTT for %v (%v)", q, rtt)
|
d.logger.Printf("[DEBUG] dns: recurse RTT for %v (%v)", q, rtt)
|
||||||
if err := resp.WriteMsg(r); err != nil {
|
if err := resp.WriteMsg(r); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user