This repository was archived by the owner on Nov 28, 2024. It is now read-only.
This repository was archived by the owner on Nov 28, 2024. It is now read-only.
Hanging Connection #67
Open
Description
The connection deadline is only set after smtpNewClient
was called. Since smtpNewClient
already wants to read 220
from the connection, a server that does not respond will result in a hanging connection.
This issue should be resolvable by moving the deadline code just after creation of the connection.
func (d *Dialer) Dial() (SendCloser, error) {
conn, err := NetDialTimeout("tcp", addr(d.Host, d.Port), d.Timeout)
if err != nil {
return nil, err
}
if d.SSL {
conn = tlsClient(conn, d.tlsConfig())
}
c, err := smtpNewClient(conn, d.Host)
if err != nil {
return nil, err
}
if d.Timeout > 0 {
conn.SetDeadline(time.Now().Add(d.Timeout))
}
Metadata
Metadata
Assignees
Labels
No labels