Merge pull request #1699 from calmh/connsvc

Break out connection handling into a service
This commit is contained in:
Audrius Butkevicius
2015-04-25 15:37:08 +01:00
2 changed files with 92 additions and 30 deletions

View File

@@ -584,7 +584,9 @@ func syncthingMain() {
// Routine to connect out to configured devices
discoverer = discovery(externalPort)
go listenConnect(myID, m, tlsCfg)
connectionSvc := newConnectionSvc(cfg, myID, m, tlsCfg)
mainSvc.Add(connectionSvc)
for _, folder := range cfg.Folders() {
// Routine to pull blocks from other devices to synchronize the local