From: Sergey Matveev Date: Fri, 9 Jul 2021 11:40:09 +0000 (+0300) Subject: Do not close fd each time chunk is sent X-Git-Tag: v7.2.1^2~2 X-Git-Url: http://www.git.cypherpunks.ru/?p=nncp.git;a=commitdiff_plain;h=09d1c2082be21e7ccd44eef12f0670541505c6ae Do not close fd each time chunk is sent --- 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,