diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-08-02 13:10:48 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-08-02 13:10:48 +0300 |
commit | 3812ffd336414904affc43d29229b04a2d6d8ae6 (patch) | |
tree | f12fca86a5e4280bd75234776cac80c9b9902d0b /src/nxt_router.c | |
parent | a7ef8481fcda2f2dc5b0b84a93e66bce62c83918 (diff) | |
download | unit-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 '')
-rw-r--r-- | src/nxt_router.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index 567c9df6..64cc53b7 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -575,7 +575,7 @@ nxt_router_conf_send(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, b->parent = tmcf->mem_pool; b->completion_handler = nxt_router_conf_buf_completion; - nxt_port_socket_write(task, tmcf->port, NXT_PORT_MSG_DATA, -1, + nxt_port_socket_write(task, tmcf->port, NXT_PORT_MSG_DATA_LAST, -1, tmcf->stream, 0, b); } @@ -1977,7 +1977,8 @@ nxt_router_send_sw_request(nxt_task_t *task, void *obj, void *data) *b->mem.free++ = '\0'; nxt_buf_cpystr(b, &app->conf); - nxt_port_socket_write(task, port, NXT_PORT_MSG_DATA, -1, sw->stream, 0, b); + nxt_port_socket_write(task, port, NXT_PORT_MSG_DATA_LAST, -1, + sw->stream, 0, b); } |