From 3812ffd336414904affc43d29229b04a2d6d8ae6 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 2 Aug 2017 13:10:48 +0300 Subject: 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. --- src/nxt_router.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nxt_router.c') 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); } -- cgit