From 39192ab56b0f14679b927d95d3a6c3f15ce77c62 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 8 Jan 2017 18:35:37 +0300 Subject: [PATCH] Do not lock when connection is gone --- src/cypherpunks.ru/nncp/sp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cypherpunks.ru/nncp/sp.go b/src/cypherpunks.ru/nncp/sp.go index f5775f9..78a0d96 100644 --- a/src/cypherpunks.ru/nncp/sp.go +++ b/src/cypherpunks.ru/nncp/sp.go @@ -800,7 +800,9 @@ func (state *SPState) ProcessSP(payload []byte) ([][]byte, error) { } state.ctx.LogI("sp-done", SdsAdd(sdsp, SDS{"xx": string(TRx)}), "") os.Rename(filePath+PartSuffix, filePath) - state.payloads <- MarshalSP(SPTypeDone, SPDone{file.Hash}) + go func() { + state.payloads <- MarshalSP(SPTypeDone, SPDone{file.Hash}) + }() }() case SPTypeDone: state.ctx.LogD( -- 2.44.0