summaryrefslogtreecommitdiffhomepage
path: root/src/nginext/nxt_go_port.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-08-02 13:10:48 +0300
committerMax Romanov <max.romanov@nginx.com>2017-08-02 13:10:48 +0300
commit3812ffd336414904affc43d29229b04a2d6d8ae6 (patch)
treef12fca86a5e4280bd75234776cac80c9b9902d0b /src/nginext/nxt_go_port.c
parenta7ef8481fcda2f2dc5b0b84a93e66bce62c83918 (diff)
downloadunit-3812ffd336414904affc43d29229b04a2d6d8ae6.tar.gz
unit-3812ffd336414904affc43d29229b04a2d6d8ae6.tar.bz2
Added bit flags to type parameter of nxt_port_socket_write().
NXT_PORT_MSG_LAST - mark message as last; NXT_PORT_MSG_CLOSE_FD - close fd right after send; Type constants altered to include last flag for single buffer messages. Last sign is critical for coming port RPC layer. Handlers unregistered on last message. Create sync buffer is not convenient, extra parameter is better.
Diffstat (limited to 'src/nginext/nxt_go_port.c')
-rw-r--r--src/nginext/nxt_go_port.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nginext/nxt_go_port.c b/src/nginext/nxt_go_port.c
index 58ba90ea..af50b860 100644
--- a/src/nginext/nxt_go_port.c
+++ b/src/nginext/nxt_go_port.c
@@ -152,13 +152,13 @@ nxt_go_port_on_read(void *buf, size_t buf_size, void *oob, size_t oob_size)
}
switch (port_msg->type) {
- case NXT_PORT_MSG_QUIT:
+ case _NXT_PORT_MSG_QUIT:
nxt_go_debug("quit");
nxt_go_set_quit();
break;
- case NXT_PORT_MSG_NEW_PORT:
+ case _NXT_PORT_MSG_NEW_PORT:
nxt_go_debug("new port");
new_port_msg = payload;
@@ -166,22 +166,22 @@ nxt_go_port_on_read(void *buf, size_t buf_size, void *oob, size_t oob_size)
-1, fd);
break;
- case NXT_PORT_MSG_CHANGE_FILE:
+ case _NXT_PORT_MSG_CHANGE_FILE:
nxt_go_debug("change file");
break;
- case NXT_PORT_MSG_MMAP:
+ case _NXT_PORT_MSG_MMAP:
nxt_go_debug("mmap");
nxt_go_new_incoming_mmap(port_msg->pid, fd);
break;
- case NXT_PORT_MSG_DATA:
+ case _NXT_PORT_MSG_DATA:
nxt_go_debug("data");
return nxt_go_data_handler(port_msg, buf_size);
- case NXT_PORT_MSG_REMOVE_PID:
+ case _NXT_PORT_MSG_REMOVE_PID:
nxt_go_debug("remove pid");
/* TODO remove all ports for this pid in Go */