parent
29f2e93ab7
commit
bca0b2ad76
@ -13,6 +13,7 @@ import (
|
|||||||
// TODO: make configurable
|
// TODO: make configurable
|
||||||
var keepAlivePeriod = time.Minute
|
var keepAlivePeriod = time.Minute
|
||||||
var retryConnectMinDelay = time.Minute
|
var retryConnectMinDelay = time.Minute
|
||||||
|
var connectTimeout = 15 * time.Second
|
||||||
var writeTimeout = 10 * time.Second
|
var writeTimeout = 10 * time.Second
|
||||||
|
|
||||||
func setKeepAlive(c net.Conn) error {
|
func setKeepAlive(c net.Conn) error {
|
||||||
|
@ -82,8 +82,10 @@ func connectToUpstream(network *network) (*upstreamConn, error) {
|
|||||||
addr = addr + ":6697"
|
addr = addr + ":6697"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dialer := net.Dialer{Timeout: connectTimeout}
|
||||||
|
|
||||||
logger.Printf("connecting to TLS server at address %q", addr)
|
logger.Printf("connecting to TLS server at address %q", addr)
|
||||||
netConn, err := tls.Dial("tcp", addr, nil)
|
netConn, err := tls.DialWithDialer(&dialer, "tcp", addr, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to dial %q: %v", addr, err)
|
return nil, fmt.Errorf("failed to dial %q: %v", addr, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user