summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-10-27 11:05:22 +0300
committerMax Romanov <max.romanov@nginx.com>2017-10-27 11:05:22 +0300
commit1d11f8cfbbc1d991767e005e0ac2b1522d0f907e (patch)
tree21bc18531bb2e2f7d44a02da3136ab91f542dda3 /src
parent51396fea832e6a0461057f0f990c9d3e9ebb65e9 (diff)
downloadunit-1d11f8cfbbc1d991767e005e0ac2b1522d0f907e.tar.gz
unit-1d11f8cfbbc1d991767e005e0ac2b1522d0f907e.tar.bz2
Fixing Go program crash.
Go request registration should be removed before C request memory freed. C request address used as a key in Go map. Freed memory can be instantly reused for other request and older request registration should removed at this point to avoid collisions.
Diffstat (limited to 'src')
-rw-r--r--src/go/unit/request.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/go/unit/request.go b/src/go/unit/request.go
index 75c06ef5..5af3db7b 100644
--- a/src/go/unit/request.go
+++ b/src/go/unit/request.go
@@ -107,10 +107,10 @@ func (r *request) response() *response {
}
func (r *request) done() {
- C.nxt_go_request_done(r.c_req)
-
remove_request(r)
+ C.nxt_go_request_done(r.c_req)
+
for _, m := range r.msgs {
m.Close()
}