lib/connections: Don't look at devices that are already optimally connected
Just an optimization. Required exposing the priority from the factory, so made that an interface with an extra method instead of just a func type. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3071
This commit is contained in:
committed by
Audrius Butkevicius
parent
31f64186ae
commit
d77d8ff803
@@ -28,7 +28,10 @@ type Connection struct {
|
||||
protocol.Connection
|
||||
}
|
||||
|
||||
type dialerFactory func(*config.Wrapper, *tls.Config) genericDialer
|
||||
type dialerFactory interface {
|
||||
New(*config.Wrapper, *tls.Config) genericDialer
|
||||
Priority() int
|
||||
}
|
||||
|
||||
type genericDialer interface {
|
||||
Dial(protocol.DeviceID, *url.URL) (IntermediateConnection, error)
|
||||
|
||||
Reference in New Issue
Block a user