From fddca3d2d698c26432d404a67e157b6ba0c922ad Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Sat, 21 May 2016 01:31:23 +0000 Subject: [PATCH] lib/connections: Do not resolve addresses (fixes #3129) GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3133 --- lib/connections/tcp_dial.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/connections/tcp_dial.go b/lib/connections/tcp_dial.go index c409680fa..0df544ebf 100644 --- a/lib/connections/tcp_dial.go +++ b/lib/connections/tcp_dial.go @@ -8,7 +8,6 @@ package connections import ( "crypto/tls" - "net" "net/url" "time" @@ -34,13 +33,7 @@ type tcpDialer struct { func (d *tcpDialer) Dial(id protocol.DeviceID, uri *url.URL) (IntermediateConnection, error) { uri = fixupPort(uri) - raddr, err := net.ResolveTCPAddr(uri.Scheme, uri.Host) - if err != nil { - l.Debugln(err) - return IntermediateConnection{}, err - } - - conn, err := dialer.DialTimeout(raddr.Network(), raddr.String(), 10*time.Second) + conn, err := dialer.DialTimeout(uri.Scheme, uri.Host, 10*time.Second) if err != nil { l.Debugln(err) return IntermediateConnection{}, err