Add incoming connection relay service

This commit is contained in:
Audrius Butkevicius
2015-06-28 20:09:53 +01:00
parent c2ccab4361
commit 27465353c1
4 changed files with 215 additions and 31 deletions

View File

@@ -668,6 +668,13 @@ func syncthingMain() {
l.Fatalln("Bad listen address:", err)
}
// Start the relevant services
connectionSvc := newConnectionSvc(cfg, myID, m, tlsCfg)
relaySvc := newRelaySvc(cfg, tlsCfg, connectionSvc.conns)
connectionSvc.Add(relaySvc)
mainSvc.Add(connectionSvc)
// Start discovery
localPort := addr.Port
@@ -681,10 +688,6 @@ func syncthingMain() {
mainSvc.Add(upnpSvc)
}
connectionSvc := newConnectionSvc(cfg, myID, m, tlsCfg)
cfg.Subscribe(connectionSvc)
mainSvc.Add(connectionSvc)
if cpuProfile {
f, err := os.Create(fmt.Sprintf("cpu-%d.pprof", os.Getpid()))
if err != nil {