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:
Miek Gieben 2018-02-17 19:45:52 +01:00 committed by GitHub
parent 9719a47c1b
commit 8cce06cba1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 37 deletions

View file

@ -55,7 +55,6 @@ func Typify(m *dns.Msg, t time.Time) (Type, *dns.OPT) {
if m == nil {
return OtherError, nil
}
opt := m.IsEdns0()
do := false
if opt != nil {
@ -77,11 +76,6 @@ func Typify(m *dns.Msg, t time.Time) (Type, *dns.OPT) {
}
}
if m.Response && len(m.Answer) == 0 && len(m.Ns) == 0 {
// Response with nothing in it, maybe stuff in the additional section, this is not useful.
return OtherError, opt
}
// If our message contains any expired sigs and we care about that, we should return expired
if do {
if expired := typifyExpired(m, t); expired {