From 09d1c2082be21e7ccd44eef12f0670541505c6ae Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 9 Jul 2021 14:40:09 +0300 Subject: [PATCH] Do not close fd each time chunk is sent --- src/sp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sp.go b/src/sp.go index 84d74bb..5840bd1 100644 --- a/src/sp.go +++ b/src/sp.go @@ -932,8 +932,9 @@ func (state *SPState) StartWorkers( logMsg(les), humanize.IBytes(uint64(n)), ) }) + } else { + state.closeFd(pth) } - state.closeFd(pth) payload = MarshalSP(SPTypeFile, SPFile{ Hash: freq.Hash, Offset: freq.Offset, -- 2.44.0