|
@@ -189,12 +189,11 @@ func reportData(m *model.Model) map[string]interface{} {
|
|
|
|
|
|
|
|
defaultAnnounceServersDNS, defaultAnnounceServersIP, otherAnnounceServers := 0, 0, 0
|
|
defaultAnnounceServersDNS, defaultAnnounceServersIP, otherAnnounceServers := 0, 0, 0
|
|
|
for _, addr := range cfg.Options().GlobalAnnServers {
|
|
for _, addr := range cfg.Options().GlobalAnnServers {
|
|
|
- switch addr {
|
|
|
|
|
- case "udp4://announce.syncthing.net:22027", "udp6://announce-v6.syncthing.net:22027":
|
|
|
|
|
|
|
+ if addr == "default" {
|
|
|
defaultAnnounceServersDNS++
|
|
defaultAnnounceServersDNS++
|
|
|
- case "udp4://194.126.249.5:22027", "udp6://[2001:470:28:4d6::5]:22027":
|
|
|
|
|
|
|
+ } else if stringIn(addr, config.DefaultDiscoveryServersIP) {
|
|
|
defaultAnnounceServersIP++
|
|
defaultAnnounceServersIP++
|
|
|
- default:
|
|
|
|
|
|
|
+ } else {
|
|
|
otherAnnounceServers++
|
|
otherAnnounceServers++
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -229,6 +228,15 @@ func reportData(m *model.Model) map[string]interface{} {
|
|
|
return res
|
|
return res
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func stringIn(needle string, haystack []string) bool {
|
|
|
|
|
+ for _, s := range haystack {
|
|
|
|
|
+ if needle == s {
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return false
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
type usageReportingService struct {
|
|
type usageReportingService struct {
|
|
|
model *model.Model
|
|
model *model.Model
|
|
|
stop chan struct{}
|
|
stop chan struct{}
|