mirror of
https://github.com/syncthing/syncthing.git
synced 2026-11-26 03:46:34 -08:00
2 files changed
+5
No files matched your search
@@ -77,6 +77,7 @@ type Options struct {
|
||||
AdvertiseAddresses []string
|
||||
Identity []byte
|
||||
Server bool
|
||||
Client bool
|
||||
ValueDatastore ds.Batching
|
||||
RoutingDatastore ds.Batching
|
||||
MaxConnections int // Zero uses libp2p defaults.
|
||||
@@ -234,6 +235,8 @@ func NewSyncthingDHT(options Options) (*DHT, error) {
|
||||
mode := kad.ModeAuto
|
||||
if options.Server {
|
||||
mode = kad.ModeServer
|
||||
} else if options.Client {
|
||||
mode = kad.ModeClient
|
||||
}
|
||||
|
||||
opts := []kad.Option{
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/syncthing/syncthing/internal/db"
|
||||
"github.com/syncthing/syncthing/internal/dht"
|
||||
"github.com/syncthing/syncthing/internal/slogutil"
|
||||
"github.com/syncthing/syncthing/lib/build"
|
||||
"github.com/syncthing/syncthing/lib/config"
|
||||
"github.com/syncthing/syncthing/lib/connections/registry"
|
||||
"github.com/syncthing/syncthing/lib/events"
|
||||
@@ -279,6 +280,7 @@ func (m *manager) CommitConfiguration(_, to config.Configuration) (handled bool)
|
||||
UDP: m.registry.UDP,
|
||||
ListenAddresses: listenAddresses,
|
||||
BootstrapPeers: bootstrapPeers,
|
||||
Client: build.IsAndroid || build.IsIOS,
|
||||
})
|
||||
if err != nil {
|
||||
slog.Warn("Failed to initialize peer-to-peer discovery", slogutil.Error(err))
|
||||
|
||||
Reference in new issue
Block a user