This adds two new configuration options:
// The number of connections at which we stop trying to connect to more
// devices, zero meaning no limit. Does not affect incoming connections.
ConnectionLimitEnough int
// The maximum number of connections which we will allow in total, zero
// meaning no limit. Affects incoming connections and prevents
// attempting outgoing connections.
ConnectionLimitMax int
These can be used to limit the number of concurrent connections in
various ways.
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/syncthing/syncthing/lib/config"
|
||||
"github.com/syncthing/syncthing/lib/nat"
|
||||
"github.com/syncthing/syncthing/lib/protocol"
|
||||
"github.com/syncthing/syncthing/lib/stats"
|
||||
|
||||
"github.com/thejerf/suture/v4"
|
||||
)
|
||||
@@ -193,9 +194,11 @@ type genericListener interface {
|
||||
type Model interface {
|
||||
protocol.Model
|
||||
AddConnection(conn protocol.Connection, hello protocol.Hello)
|
||||
NumConnections() int
|
||||
Connection(remoteID protocol.DeviceID) (protocol.Connection, bool)
|
||||
OnHello(protocol.DeviceID, net.Addr, protocol.Hello) error
|
||||
GetHello(protocol.DeviceID) protocol.HelloIntf
|
||||
DeviceStatistics() (map[protocol.DeviceID]stats.DeviceStatistics, error)
|
||||
}
|
||||
|
||||
type onAddressesChangedNotifier struct {
|
||||
|
||||
Reference in New Issue
Block a user