From b7fd537de7ebfaa2958c0c2c4d7f3c95e2a77104 Mon Sep 17 00:00:00 2001 From: xiaolunzhou <51695571+JayL-zxl@users.noreply.github.com> Date: Mon, 7 Dec 2020 20:00:31 +0800 Subject: [PATCH] Update client.go --- dns/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/client.go b/dns/client.go index 9f7eb8e..fd4d2db 100644 --- a/dns/client.go +++ b/dns/client.go @@ -203,12 +203,12 @@ func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) ( continue } //TODO: if we use DOH (network=="doh") we don't need close connection - if network!="doh"{ + if op!="doh"{ defer rc.Close() } // TODO: support timeout setting for different upstream server - if c.config.Timeout > 0 && network!="doh" { + if c.config.Timeout > 0 && op!="doh" { rc.SetDeadline(time.Now().Add(time.Duration(c.config.Timeout) * time.Second)) }