mirror of
https://github.com/coredns/coredns.git
synced 2025-12-09 03:45:11 -05:00
truncated cache fix (#485)
This commit is contained in:
committed by
Miek Gieben
parent
a1215974ee
commit
c68dc7c1aa
2
middleware/cache/handler.go
vendored
2
middleware/cache/handler.go
vendored
@@ -25,9 +25,9 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
|||||||
do := state.Do() // TODO(): might need more from OPT record? Like the actual bufsize?
|
do := state.Do() // TODO(): might need more from OPT record? Like the actual bufsize?
|
||||||
|
|
||||||
if i, ok, expired := c.get(qname, qtype, do); ok && !expired {
|
if i, ok, expired := c.get(qname, qtype, do); ok && !expired {
|
||||||
|
|
||||||
resp := i.toMsg(r)
|
resp := i.toMsg(r)
|
||||||
state.SizeAndDo(resp)
|
state.SizeAndDo(resp)
|
||||||
|
resp, _ = state.Scrub(resp)
|
||||||
w.WriteMsg(resp)
|
w.WriteMsg(resp)
|
||||||
|
|
||||||
return dns.RcodeSuccess, nil
|
return dns.RcodeSuccess, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user