mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-19 22:58:03 +03:00
refactor: new dns app
This commit is contained in:
@ -20,7 +20,7 @@ func (FakeDNSServer) Name() string {
|
||||
return "FakeDNS"
|
||||
}
|
||||
|
||||
func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ dns.IPOption) ([]net.IP, error) {
|
||||
func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ net.IP, _ dns.IPOption, _ bool) ([]net.IP, error) {
|
||||
if f.fakeDNSEngine == nil {
|
||||
if err := core.RequireFeatures(ctx, func(fd dns.FakeDNSEngine) {
|
||||
f.fakeDNSEngine = fd
|
||||
@ -30,9 +30,9 @@ func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ dns.IPOpti
|
||||
}
|
||||
ips := f.fakeDNSEngine.GetFakeIPForDomain(domain)
|
||||
|
||||
netIP := toNetIP(ips)
|
||||
if netIP == nil {
|
||||
return nil, newError("Unable to convert IP to net ip").AtError()
|
||||
netIP, err := toNetIP(ips)
|
||||
if err != nil {
|
||||
return nil, newError("Unable to convert IP to net ip").Base(err).AtError()
|
||||
}
|
||||
|
||||
newError(f.Name(), " got answer: ", domain, " -> ", ips).AtInfo().WriteToLog()
|
||||
|
Reference in New Issue
Block a user