Fixed host completion in 'connect'

This commit is contained in:
Maksim Stepanov 2016-01-16 20:28:14 +03:00
parent e810b2faca
commit 0e6327115f

View File

@ -70,12 +70,12 @@ func connect(host, user, passwd string) (net.Conn, error) {
if strings.TrimSpace(host) == "" { if strings.TrimSpace(host) == "" {
a := strings.SplitN(user, "@", 2) a := strings.SplitN(user, "@", 2)
if len(a) == 2 { if len(a) == 2 {
host = a[1] addr = a[1]
} }
} }
a := strings.SplitN(host, ":", 2) a := strings.SplitN(host, ":", 2)
if len(a) == 1 { if len(a) == 1 {
host += ":5222" addr += ":5222"
} }
proxy := os.Getenv("HTTP_PROXY") proxy := os.Getenv("HTTP_PROXY")
if proxy == "" { if proxy == "" {