Error handling when TCP connections fail

This commit is contained in:
Frank Denis 2018-06-18 19:19:53 +02:00
parent 86de4be519
commit a1c8012fc6
1 changed files with 3 additions and 0 deletions

View File

@ -282,6 +282,9 @@ func (proxy *Proxy) exchangeWithTCPServer(serverInfo *ServerInfo, sharedKey *[32
} else {
pc, err = (*proxyDialer).Dial("tcp", serverInfo.TCPAddr.String())
}
if err != nil {
return nil, err
}
pc.SetDeadline(time.Now().Add(serverInfo.Timeout))
encryptedQuery, err = PrefixWithSize(encryptedQuery)
if err != nil {