Chore: IpToAddr

This commit is contained in:
yaling888
2022-04-19 17:46:13 +08:00
committed by adlyq
parent 42d853a7e6
commit 6c4791480e
14 changed files with 136 additions and 119 deletions

View File

@ -7,6 +7,7 @@ import (
"time"
"github.com/Dreamacro/clash/common/cache"
"github.com/Dreamacro/clash/common/nnip"
"github.com/Dreamacro/clash/component/fakeip"
"github.com/Dreamacro/clash/component/trie"
C "github.com/Dreamacro/clash/constant"
@ -101,7 +102,7 @@ func withMapping(mapping *cache.LruCache[netip.Addr, string]) middleware {
continue
}
mapping.SetWithExpire(ipToAddr(ip), host, time.Now().Add(time.Second*time.Duration(ttl)))
mapping.SetWithExpire(nnip.IpToAddr(ip), host, time.Now().Add(time.Second*time.Duration(ttl)))
}
return msg, nil