mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
lib/connections: Do not resolve addresses (fixes #3129)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3133
This commit is contained in:
parent
9db49fb45e
commit
fddca3d2d6
@ -8,7 +8,6 @@ package connections
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"net"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -34,13 +33,7 @@ type tcpDialer struct {
|
|||||||
func (d *tcpDialer) Dial(id protocol.DeviceID, uri *url.URL) (IntermediateConnection, error) {
|
func (d *tcpDialer) Dial(id protocol.DeviceID, uri *url.URL) (IntermediateConnection, error) {
|
||||||
uri = fixupPort(uri)
|
uri = fixupPort(uri)
|
||||||
|
|
||||||
raddr, err := net.ResolveTCPAddr(uri.Scheme, uri.Host)
|
conn, err := dialer.DialTimeout(uri.Scheme, uri.Host, 10*time.Second)
|
||||||
if err != nil {
|
|
||||||
l.Debugln(err)
|
|
||||||
return IntermediateConnection{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
conn, err := dialer.DialTimeout(raddr.Network(), raddr.String(), 10*time.Second)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Debugln(err)
|
l.Debugln(err)
|
||||||
return IntermediateConnection{}, err
|
return IntermediateConnection{}, err
|
||||||
|
Loading…
Reference in New Issue
Block a user