staticClient.connect(): don't handshake twice (fixes #2547, #2548)

The first handshake occurred before setting the Deadline, which could
cause an unintended hang.
This commit is contained in:
Antony Male 2015-12-04 11:18:58 +00:00
parent 86e8e5199e
commit 345d727936

View File

@ -200,9 +200,6 @@ func (c *staticClient) connect() error {
c.mut.Unlock()
conn := tls.Client(tcpConn, c.config)
if err = conn.Handshake(); err != nil {
return err
}
if err := conn.SetDeadline(time.Now().Add(c.connectTimeout)); err != nil {
conn.Close()