lib/protocol: Don't block on Close (fixes #5794) (#5795)

This commit is contained in:
Simon Frei
2019-06-14 19:04:41 +02:00
committed by Jakob Borg
parent 6b1d7ac727
commit 02752af862
3 changed files with 28 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ type TestModel struct {
weakHash uint32
fromTemporary bool
indexFn func(DeviceID, string, []FileInfo)
ccFn func(DeviceID, ClusterConfig)
closedCh chan struct{}
closedErr error
}
@@ -52,6 +53,9 @@ func (t *TestModel) Closed(conn Connection, err error) {
}
func (t *TestModel) ClusterConfig(deviceID DeviceID, config ClusterConfig) {
if t.ccFn != nil {
t.ccFn(deviceID, config)
}
}
func (t *TestModel) DownloadProgress(DeviceID, string, []FileDownloadProgressUpdate) {