lib/connections: Parallel dials in the same priority (fixes #4456)
Well Tested(TM) Introduces a potential issue where we always pick some connectable but dodgy connection that breaks soon after the TLS handshake. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4489
This commit is contained in:
committed by
Jakob Borg
parent
783dd612f7
commit
aecd7c64ce
@@ -177,3 +177,17 @@ func (o *onAddressesChangedNotifier) notifyAddressesChanged(l genericListener) {
|
||||
callback(l)
|
||||
}
|
||||
}
|
||||
|
||||
type dialTarget struct {
|
||||
dialer genericDialer
|
||||
priority int
|
||||
uri *url.URL
|
||||
deviceID protocol.DeviceID
|
||||
}
|
||||
|
||||
func (t dialTarget) Dial() (internalConn, error) {
|
||||
l.Debugln("dialing", t.deviceID, t.uri, "prio", t.priority)
|
||||
conn, err := t.dialer.Dial(t.deviceID, t.uri)
|
||||
l.Debugln("dialing", t.deviceID, t.uri, "outcome", conn, err)
|
||||
return conn, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user