mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 02:14:40 +01:00
add timeout for udp and tcp dialer
This commit is contained in:
parent
42b6ae9052
commit
956a14ee21
1 changed files with 2 additions and 2 deletions
|
@ -517,7 +517,7 @@ func (proxy *Proxy) exchangeWithUDPServer(
|
|||
var pc net.Conn
|
||||
proxyDialer := proxy.xTransport.proxyDialer
|
||||
if proxyDialer == nil {
|
||||
pc, err = net.DialUDP("udp", nil, upstreamAddr)
|
||||
pc, err = net.DialTimeout("udp", upstreamAddr.String(), serverInfo.Timeout)
|
||||
} else {
|
||||
pc, err = (*proxyDialer).Dial("udp", upstreamAddr.String())
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ func (proxy *Proxy) exchangeWithTCPServer(
|
|||
var pc net.Conn
|
||||
proxyDialer := proxy.xTransport.proxyDialer
|
||||
if proxyDialer == nil {
|
||||
pc, err = net.DialTCP("tcp", nil, upstreamAddr)
|
||||
pc, err = net.DialTimeout("tcp", upstreamAddr.String(), serverInfo.Timeout)
|
||||
} else {
|
||||
pc, err = (*proxyDialer).Dial("tcp", upstreamAddr.String())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue