mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
taildrop: fix defer in loop (#13757)
However, this affects the scope of a defer. Updates #11038 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
parent
5b7303817e
commit
52ef27ab7c
@ -228,7 +228,6 @@ func (m *Manager) IncomingFiles() []ipn.PartialFile {
|
|||||||
files := make([]ipn.PartialFile, 0)
|
files := make([]ipn.PartialFile, 0)
|
||||||
for k, f := range m.incomingFiles.All() {
|
for k, f := range m.incomingFiles.All() {
|
||||||
f.mu.Lock()
|
f.mu.Lock()
|
||||||
defer f.mu.Unlock()
|
|
||||||
files = append(files, ipn.PartialFile{
|
files = append(files, ipn.PartialFile{
|
||||||
Name: k.name,
|
Name: k.name,
|
||||||
Started: f.started,
|
Started: f.started,
|
||||||
@ -238,6 +237,7 @@ func (m *Manager) IncomingFiles() []ipn.PartialFile {
|
|||||||
FinalPath: f.finalPath,
|
FinalPath: f.finalPath,
|
||||||
Done: f.done,
|
Done: f.done,
|
||||||
})
|
})
|
||||||
|
f.mu.Unlock()
|
||||||
}
|
}
|
||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user