diff options
author | Andrei Belov <defan@nginx.com> | 2020-04-16 18:27:26 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2020-04-16 18:27:26 +0300 |
commit | 74f32d26b91f49d3392605e81c1597b375890b60 (patch) | |
tree | adfc67dfc86461441bde65512f745ce27bd6ea28 /go | |
parent | 2ff9df10ef1df43c935c870175e52473dad2c21a (diff) | |
parent | 9877087756144d3bdf343d0d4e91e1efbcc62c93 (diff) | |
download | unit-1.17.0-1.tar.gz unit-1.17.0-1.tar.bz2 |
Merged with the default branch.1.17.0-1
Diffstat (limited to '')
-rw-r--r-- | go/port.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -50,7 +50,11 @@ func add_port(p *port) { port_registry_.m = make(map[port_key]*port) } - port_registry_.m[p.key] = p + old := port_registry_.m[p.key] + + if old == nil { + port_registry_.m[p.key] = p + } port_registry_.Unlock() } @@ -138,6 +142,8 @@ func nxt_go_port_send(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int, if err != nil { nxt_go_warn("write result %d (%d), %s", n, oobn, err) + + n = -1 } return C.ssize_t(n) @@ -164,6 +170,8 @@ func nxt_go_port_recv(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int, if err != nil { nxt_go_warn("read result %d (%d), %s", n, oobn, err) + + n = -1 } return C.ssize_t(n) |