mirror of
https://github.com/coredns/coredns.git
synced 2025-12-07 19:05:19 -05:00
Type.extra (#1538)
* Revert "pkg/typify: empty messages are OtherError (#1531)"
This reverts commit fc1d73ffa9.
* plugin/cache: add failsafeTTL
If we can not see what TTL we should put on a message to be cached, use
5 seconds as minimal TTL. We used to apply the maximum TTL to these
messages.
This commit is contained in:
5
plugin/cache/item.go
vendored
5
plugin/cache/item.go
vendored
@@ -95,6 +95,11 @@ func minMsgTTL(m *dns.Msg, mt response.Type) time.Duration {
|
||||
return 0
|
||||
}
|
||||
|
||||
// No data to examine, return a short ttl as a fail safe.
|
||||
if len(m.Answer)+len(m.Ns) == 0 {
|
||||
return failSafeTTL
|
||||
}
|
||||
|
||||
minTTL := maxTTL
|
||||
for _, r := range append(m.Answer, m.Ns...) {
|
||||
switch mt {
|
||||
|
||||
Reference in New Issue
Block a user