From d8bd04e7e13197ff7133a1d1a97fd27bdde0445b Mon Sep 17 00:00:00 2001 From: Francois Tur Date: Mon, 4 Jun 2018 16:36:08 -0400 Subject: [PATCH] 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. --- client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client.go b/client.go index 5ec07f6a..dd6b512a 100644 --- a/client.go +++ b/client.go @@ -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