optimize(dns): cache all qtype (not only a/aaaa) (#167)

This commit is contained in:
mzz 2023-07-07 14:54:23 +08:00 committed by GitHub
parent 56e6c1658f
commit 0d05e88e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,6 @@ import (
"encoding/binary"
"errors"
"fmt"
"github.com/daeuniverse/dae/common"
"io"
"math"
"net"
@ -19,6 +18,8 @@ import (
"sync"
"time"
"github.com/daeuniverse/dae/common"
"github.com/daeuniverse/dae/common/consts"
"github.com/daeuniverse/dae/common/netutils"
"github.com/daeuniverse/dae/component/dns"
@ -157,11 +158,6 @@ func (c *DnsController) LookupDnsRespCache_(msg *dnsmessage.Message) (resp []byt
if msg.Response {
return nil
}
switch q.Type {
case dnsmessage.TypeA, dnsmessage.TypeAAAA:
default:
return nil
}
cache := c.LookupDnsRespCache(q.Name.String(), q.Type)
if cache != nil {
cache.FillInto(msg)