summaryrefslogtreecommitdiffhomepage
path: root/src/go/unit/port.go
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-09-06 02:30:55 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-09-06 02:30:55 +0300
commit58907888e510f6907513da2ea4506ee78b9bf77c (patch)
tree1d16cf9fb4ad4d21c23b3c825c48408b75a13ef4 /src/go/unit/port.go
parent22ae3d4ff55ae778688a89c585b5da8eddce6cc0 (diff)
downloadunit-58907888e510f6907513da2ea4506ee78b9bf77c.tar.gz
unit-58907888e510f6907513da2ea4506ee78b9bf77c.tar.bz2
Style fixes.
Diffstat (limited to 'src/go/unit/port.go')
-rw-r--r--src/go/unit/port.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/go/unit/port.go b/src/go/unit/port.go
index a8faa2a0..74b5e8fe 100644
--- a/src/go/unit/port.go
+++ b/src/go/unit/port.go
@@ -124,7 +124,9 @@ func nxt_go_new_port(pid C.int, id C.int, t C.int, rcv C.int, snd C.int) {
}
//export nxt_go_port_send
-func nxt_go_port_send(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int, oob unsafe.Pointer, oob_size C.int) C.int {
+func nxt_go_port_send(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int,
+ oob unsafe.Pointer, oob_size C.int) C.int {
+
key := port_key{
pid: int(pid),
id: int(id),
@@ -133,7 +135,8 @@ func nxt_go_port_send(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int, o
p := find_port(key)
if p != nil {
- n, oobn, err := p.snd.WriteMsgUnix(C.GoBytes(buf, buf_size), C.GoBytes(oob, oob_size), nil)
+ n, oobn, err := p.snd.WriteMsgUnix(C.GoBytes(buf, buf_size),
+ C.GoBytes(oob, oob_size), nil)
if err != nil {
fmt.Printf("write result %d (%d), %s\n", n, oobn, err)
@@ -146,11 +149,14 @@ func nxt_go_port_send(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int, o
}
//export nxt_go_main_send
-func nxt_go_main_send(buf unsafe.Pointer, buf_size C.int, oob unsafe.Pointer, oob_size C.int) C.int {
+func nxt_go_main_send(buf unsafe.Pointer, buf_size C.int, oob unsafe.Pointer,
+ oob_size C.int) C.int {
+
p := main_port()
if p != nil {
- n, oobn, err := p.snd.WriteMsgUnix(C.GoBytes(buf, buf_size), C.GoBytes(oob, oob_size), nil)
+ n, oobn, err := p.snd.WriteMsgUnix(C.GoBytes(buf, buf_size),
+ C.GoBytes(oob, oob_size), nil)
if err != nil {
fmt.Printf("write result %d (%d), %s\n", n, oobn, err)
@@ -168,7 +174,7 @@ func new_port(pid int, id int, t int, rcv int, snd int) *port {
pid: pid,
id: id,
},
- t: t,
+ t: t,
rcv: getUnixConn(rcv),
snd: getUnixConn(snd),
}