From: Sergey Matveev Date: Sun, 8 Jan 2017 15:35:37 +0000 (+0300) Subject: Do not lock when connection is gone X-Git-Tag: 0.1~15 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=39192ab56b0f14679b927d95d3a6c3f15ce77c62;p=nncp.git Do not lock when connection is gone --- 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(