Fix DialTimeout for direct call of Dial (#691)
* ensure dialTimeout is used at Dial time. Ensure dial functions setup the right timeout * - on Dialing, ensure a dialTimeout for the Dialer only if it is just created, else keep going with parameters of the Dialer.
This commit is contained in:
parent
8ccae88257
commit
d8bd04e7e1
|
@ -89,11 +89,10 @@ func (c *Client) Dial(address string) (conn *Conn, err error) {
|
|||
// create a new dialer with the appropriate timeout
|
||||
var d net.Dialer
|
||||
if c.Dialer == nil {
|
||||
d = net.Dialer{}
|
||||
d = net.Dialer{Timeout:c.getTimeoutForRequest(c.dialTimeout())}
|
||||
} else {
|
||||
d = net.Dialer(*c.Dialer)
|
||||
}
|
||||
d.Timeout = c.getTimeoutForRequest(c.writeTimeout())
|
||||
|
||||
network := "udp"
|
||||
useTLS := false
|
||||
|
|
Loading…
Reference in New Issue