mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-19 14:48:03 +03:00
Refine DNS strategies
This commit is contained in:
@ -20,7 +20,7 @@ type Server interface {
|
||||
// Name of the Client.
|
||||
Name() string
|
||||
// QueryIP sends IP queries to its configured server.
|
||||
QueryIP(ctx context.Context, domain string, clientIP net.IP, option dns.IPOption, disableCache bool) ([]net.IP, error)
|
||||
QueryIP(ctx context.Context, domain string, clientIP net.IP, option dns.IPOption, cs CacheStrategy) ([]net.IP, error)
|
||||
}
|
||||
|
||||
// Client is the interface for DNS client.
|
||||
@ -177,9 +177,9 @@ func (c *Client) Name() string {
|
||||
}
|
||||
|
||||
// QueryIP send DNS query to the name server with the client's IP.
|
||||
func (c *Client) QueryIP(ctx context.Context, domain string, option dns.IPOption, disableCache bool) ([]net.IP, error) {
|
||||
func (c *Client) QueryIP(ctx context.Context, domain string, option dns.IPOption, cs CacheStrategy) ([]net.IP, error) {
|
||||
ctx, cancel := context.WithTimeout(ctx, 4*time.Second)
|
||||
ips, err := c.server.QueryIP(ctx, domain, c.clientIP, option, disableCache)
|
||||
ips, err := c.server.QueryIP(ctx, domain, c.clientIP, option, cs)
|
||||
cancel()
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user