lib/protocol: Don't call receiver after calling Closed (fixes #4170) (#5742)

* lib/protocol: Don't call receiver after calling Closed (fixes #4170)

* review
This commit is contained in:
Simon Frei
2019-05-25 21:08:07 +02:00
committed by Audrius Butkevicius
parent d91da8feee
commit 9e6db72535
3 changed files with 97 additions and 27 deletions

View File

@@ -13,6 +13,7 @@ type TestModel struct {
hash []byte
weakHash uint32
fromTemporary bool
indexFn func(DeviceID, string, []FileInfo)
closedCh chan struct{}
closedErr error
}
@@ -24,6 +25,9 @@ func newTestModel() *TestModel {
}
func (t *TestModel) Index(deviceID DeviceID, folder string, files []FileInfo) {
if t.indexFn != nil {
t.indexFn(deviceID, folder, files)
}
}
func (t *TestModel) IndexUpdate(deviceID DeviceID, folder string, files []FileInfo) {