mirror of
https://github.com/nadoo/glider.git
synced 2025-04-22 04:02:07 +08:00
Update client.go
This commit is contained in:
parent
5f8800d643
commit
b7fd537de7
@ -203,12 +203,12 @@ func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) (
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
//TODO: if we use DOH (network=="doh") we don't need close connection
|
//TODO: if we use DOH (network=="doh") we don't need close connection
|
||||||
if network!="doh"{
|
if op!="doh"{
|
||||||
defer rc.Close()
|
defer rc.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: support timeout setting for different upstream server
|
// 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))
|
rc.SetDeadline(time.Now().Add(time.Duration(c.config.Timeout) * time.Second))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user