From dbcdb4c13d8817d9a87b52023bce97a833b05b92 Mon Sep 17 00:00:00 2001 From: Andrew Brampton Date: Sun, 30 Nov 2014 10:09:17 -0800 Subject: [PATCH] Fixed the building of the server/port string to be IPv6 safe. --- client/connection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/connection.go b/client/connection.go index 9aaf098..9e69cc6 100644 --- a/client/connection.go +++ b/client/connection.go @@ -225,7 +225,7 @@ func (conn *Conn) Connect() error { } if conn.cfg.SSL { if !hasPort(conn.cfg.Server) { - conn.cfg.Server += ":6697" + conn.cfg.Server = net.JoinHostPort(conn.cfg.Server, "6697") } logging.Info("irc.Connect(): Connecting to %s with SSL.", conn.cfg.Server) if s, err := tls.DialWithDialer(conn.dialer, "tcp", conn.cfg.Server, conn.cfg.SSLConfig); err == nil { @@ -235,7 +235,7 @@ func (conn *Conn) Connect() error { } } else { if !hasPort(conn.cfg.Server) { - conn.cfg.Server += ":6667" + conn.cfg.Server = net.JoinHostPort(conn.cfg.Server, "6667") } logging.Info("irc.Connect(): Connecting to %s without SSL.", conn.cfg.Server) if s, err := conn.dialer.Dial("tcp", conn.cfg.Server); err == nil {