From dde47a6a3277c70392aebfb5d6b8f098369e3268 Mon Sep 17 00:00:00 2001 From: kyle Date: Sat, 20 Dec 2014 19:36:08 +0200 Subject: [PATCH] fixed inconsistencies --- client/connection.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/client/connection.go b/client/connection.go index e9c7708..c7ba956 100644 --- a/client/connection.go +++ b/client/connection.go @@ -227,15 +227,12 @@ func (conn *Conn) Connect() error { if conn.connected { return fmt.Errorf("irc.Connect(): Cannot connect to %s, already connected.", conn.cfg.Server) } + conn.dialer.Timeout = conn.cfg.Timeout if conn.cfg.SSL { if !hasPort(conn.cfg.Server) { conn.cfg.Server = net.JoinHostPort(conn.cfg.Server, "6697") } - if &conn.cfg.Timeout != nil { - conn.cfg.Timeout = (60 * time.Second) - } logging.Info("irc.Connect(): Connecting to %s with SSL.", conn.cfg.Server) - conn.dialer.Timeout = conn.cfg.Timeout if s, err := tls.DialWithDialer(conn.dialer, "tcp", conn.cfg.Server, conn.cfg.SSLConfig); err == nil { conn.sock = s } else { @@ -245,11 +242,8 @@ func (conn *Conn) Connect() error { if !hasPort(conn.cfg.Server) { conn.cfg.Server = net.JoinHostPort(conn.cfg.Server, "6667") } - if &conn.cfg.Timeout != nil { - conn.cfg.Timeout = (60 * time.Second) - } logging.Info("irc.Connect(): Connecting to %s without SSL.", conn.cfg.Server) - if s, err := conn.dialer.DialTimeout("tcp", conn.cfg.Server, conn.cfg.Timeout); err == nil { + if s, err := conn.dialer.Dial("tcp", conn.cfg.Server); err == nil { conn.sock = s } else { return err