diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-07-18 22:27:13 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-07-18 22:27:13 +0300 |
commit | 21de5c1d1895495477c39f47449f57b680e34140 (patch) | |
tree | beb1af6400402ecec22395a6b6f9df864483f16a /src/nxt_router.c | |
parent | ee5b018cc289e4fb3510efb07c61116b7e4acfdf (diff) | |
download | unit-21de5c1d1895495477c39f47449f57b680e34140.tar.gz unit-21de5c1d1895495477c39f47449f57b680e34140.tar.bz2 |
Added application name in process title.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_router.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index fbd3462e..0774b158 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -1930,6 +1930,7 @@ nxt_router_gen_error(nxt_task_t *task, nxt_conn_t *c, int code, static void nxt_router_send_sw_request(nxt_task_t *task, void *obj, void *data) { + size_t size; nxt_buf_t *b; nxt_app_t *app; nxt_port_t *port; @@ -1961,8 +1962,12 @@ nxt_router_send_sw_request(nxt_task_t *task, void *obj, void *data) rt = task->thread->runtime; port = rt->port_by_type[NXT_PROCESS_MASTER]; - b = nxt_buf_mem_alloc(port->mem_pool, app->conf.length, 0); + size = app->name.length + 1 + app->conf.length; + b = nxt_buf_mem_alloc(port->mem_pool, size, 0); + + nxt_buf_cpystr(b, &app->name); + *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); |