lib/model: Fix locking around introduction handling (fixes #3737)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3738
This commit is contained in:
Jakob Borg 2016-11-17 08:50:24 +00:00 committed by Audrius Butkevicius
parent 3088dac33b
commit faee1d5a8d

View File

@ -857,7 +857,6 @@ func (m *Model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
go sendIndexes(conn, folder.ID, fs, m.folderIgnores[folder.ID], startSequence, dbLocation)
}
m.fmut.Unlock()
// This breaks if we send multiple CM messages during the same connection.
if len(tempIndexFolders) > 0 {
@ -883,6 +882,7 @@ func (m *Model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
changed = true
}
}
m.fmut.Unlock()
if changed {
if err := m.cfg.Save(); err != nil {