dns: SetDeadline for all remote connection

This commit is contained in:
nadoo committed 2018-10-20 21:24:11 +08:00
1 parent 515a5dffa5
commit 14b072832d
4 files changed
+6 -5

No files matched your search

+1 -3
View File
@@ -149,9 +149,7 @@ func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) (server
defer rc.Close()
// TODO: support timeout setting for different upstream server
if len(servers) > 1 {
rc.SetDeadline(time.Now().Add(time.Duration(c.config.Timeout) * time.Second))
}
rc.SetDeadline(time.Now().Add(time.Duration(c.config.Timeout) * time.Second))
switch network {
case "tcp":