From 9d9f5c31557f147cc545738d49ae5a15ace8ce7f Mon Sep 17 00:00:00 2001 From: xiaolunzhou <51695571+JayL-zxl@users.noreply.github.com> Date: Tue, 8 Dec 2020 10:01:16 +0800 Subject: [PATCH] Update client.go --- dns/client.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dns/client.go b/dns/client.go index 9a2798d..d2a5a8f 100644 --- a/dns/client.go +++ b/dns/client.go @@ -52,8 +52,7 @@ func NewClient(proxy proxy.Proxy, config *Config) (*Client, error) { config: config, upStream: NewUPStream(config.Servers), upStreamMap: make(map[string]*UPStream), - httpClient: &http.Client{ - }, + httpClient: &http.Client{}, } // custom records @@ -193,7 +192,6 @@ func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) ( case "doh": net.DefaultResolver = &net.Resolver{} default: - scheme=network break } if e != nil { @@ -212,7 +210,6 @@ func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) ( if c.config.Timeout > 0 && scheme != "doh" { rc.SetDeadline(time.Now().Add(time.Duration(c.config.Timeout) * time.Second)) } - switch scheme { case "tcp", "dot": respBytes, err = c.exchangeTCP(rc, reqBytes)