mirror of https://github.com/fluffle/goirc
Fixed the building of the server/port string to be IPv6 safe.
This commit is contained in:
parent
28d81b1146
commit
dbcdb4c13d
|
@ -225,7 +225,7 @@ func (conn *Conn) Connect() error {
|
||||||
}
|
}
|
||||||
if conn.cfg.SSL {
|
if conn.cfg.SSL {
|
||||||
if !hasPort(conn.cfg.Server) {
|
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)
|
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 {
|
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 {
|
} else {
|
||||||
if !hasPort(conn.cfg.Server) {
|
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)
|
logging.Info("irc.Connect(): Connecting to %s without SSL.", conn.cfg.Server)
|
||||||
if s, err := conn.dialer.Dial("tcp", conn.cfg.Server); err == nil {
|
if s, err := conn.dialer.Dial("tcp", conn.cfg.Server); err == nil {
|
||||||
|
|
Loading…
Reference in New Issue