mirror of
https://github.com/coredns/coredns.git
synced 2025-11-08 13:06:24 -05:00
plugin/proxy: Fix unnecessary message truncation (#1477)
As plugin/proxy always returns compressed messages, it's important to set this before calling Scrub(), as some messages will be unnecessarily truncated otherwise.
This commit is contained in:
committed by
Miek Gieben
parent
64d7268ed6
commit
0af9b9b16f
@@ -63,10 +63,12 @@ func (d *dnsEx) Exchange(ctx context.Context, addr string, state request.Request
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Make sure it fits in the DNS response.
|
|
||||||
reply, _ = state.Scrub(reply)
|
|
||||||
reply.Compress = true
|
reply.Compress = true
|
||||||
reply.Id = state.Req.Id
|
reply.Id = state.Req.Id
|
||||||
|
// When using force_tcp the upstream can send a message that is too big for
|
||||||
|
// the udp buffer, hence we need to truncate the message to at least make it
|
||||||
|
// fit the udp buffer.
|
||||||
|
reply, _ = state.Scrub(reply)
|
||||||
|
|
||||||
return reply, nil
|
return reply, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user