mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-05 16:00:24 +07:00
optimize(dns): cache all qtype (not only a/aaaa) (#167)
This commit is contained in:
@ -10,7 +10,6 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/daeuniverse/dae/common"
|
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"net"
|
"net"
|
||||||
@ -19,6 +18,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/daeuniverse/dae/common"
|
||||||
|
|
||||||
"github.com/daeuniverse/dae/common/consts"
|
"github.com/daeuniverse/dae/common/consts"
|
||||||
"github.com/daeuniverse/dae/common/netutils"
|
"github.com/daeuniverse/dae/common/netutils"
|
||||||
"github.com/daeuniverse/dae/component/dns"
|
"github.com/daeuniverse/dae/component/dns"
|
||||||
@ -157,11 +158,6 @@ func (c *DnsController) LookupDnsRespCache_(msg *dnsmessage.Message) (resp []byt
|
|||||||
if msg.Response {
|
if msg.Response {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
switch q.Type {
|
|
||||||
case dnsmessage.TypeA, dnsmessage.TypeAAAA:
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
cache := c.LookupDnsRespCache(q.Name.String(), q.Type)
|
cache := c.LookupDnsRespCache(q.Name.String(), q.Type)
|
||||||
if cache != nil {
|
if cache != nil {
|
||||||
cache.FillInto(msg)
|
cache.FillInto(msg)
|
||||||
|
Reference in New Issue
Block a user