New port number for new format global discovery

This commit is contained in:
Jakob Borg
2014-07-13 09:33:44 +02:00
parent 864bb8bc34
commit b7cf8a471f
5 changed files with 45 additions and 39 deletions

View File

@@ -144,7 +144,7 @@ type NodeConfiguration struct {
type OptionsConfiguration struct {
ListenAddress []string `xml:"listenAddress" default:"0.0.0.0:22000"`
GlobalAnnServer string `xml:"globalAnnounceServer" default:"announce.syncthing.net:22025"`
GlobalAnnServer string `xml:"globalAnnounceServer" default:"announce.syncthing.net:22026"`
GlobalAnnEnabled bool `xml:"globalAnnounceEnabled" default:"true"`
LocalAnnEnabled bool `xml:"localAnnounceEnabled" default:"true"`
LocalAnnPort int `xml:"localAnnouncePort" default:"21025"`
@@ -362,6 +362,12 @@ func Load(rd io.Reader, myID protocol.NodeID) (Configuration, error) {
}
}
// The global discovery format and port number changed in v0.9. Having the
// default announce server but old port number is guaranteed to be legacy.
if cfg.Options.GlobalAnnServer == "announce.syncthing.net:22025" {
cfg.Options.GlobalAnnServer = "announce.syncthing.net:22026"
}
return cfg, err
}