Chore: skip cache acme challenge dns msg (#2469)
This commit is contained in:
parent
f9027ef597
commit
b9dbd81038
1 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Dreamacro/clash/common/cache"
|
"github.com/Dreamacro/clash/common/cache"
|
||||||
|
@ -16,6 +17,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func putMsgToCache(c *cache.LruCache, key string, msg *D.Msg) {
|
func putMsgToCache(c *cache.LruCache, key string, msg *D.Msg) {
|
||||||
|
// skip dns cache for acme challenge
|
||||||
|
if q := msg.Question[0]; q.Qtype == D.TypeTXT && strings.HasPrefix(q.Name, "_acme-challenge") {
|
||||||
|
log.Debugln("[DNS] dns cache ignored because of acme challenge for: %s", q.Name)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var ttl uint32
|
var ttl uint32
|
||||||
switch {
|
switch {
|
||||||
case len(msg.Answer) != 0:
|
case len(msg.Answer) != 0:
|
||||||
|
|
Loading…
Reference in a new issue