]> Cypherpunks.ru repositories - nncp.git/commitdiff
Do not lock when connection is gone
authorSergey Matveev <stargrave@stargrave.org>
Sun, 8 Jan 2017 15:35:37 +0000 (18:35 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 8 Jan 2017 15:35:37 +0000 (18:35 +0300)
src/cypherpunks.ru/nncp/sp.go

index f5775f9bdf8704a36cc238211338219862635962..78a0d96d407a01255d22461542f8c6db3a119b49 100644 (file)
@@ -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(