diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-10-17 16:22:38 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-10-17 16:22:38 +0300 |
commit | 09ef66d39c277ed709e2333f992b1d87304bf663 (patch) | |
tree | 980e60508cb4c86b2a6637616001d10eaeb8f393 /src/nxt_router.c | |
parent | 1c6d4d8cff1f9c2da56ce6cc433c17b2d69fca2b (diff) | |
download | unit-09ef66d39c277ed709e2333f992b1d87304bf663.tar.gz unit-09ef66d39c277ed709e2333f992b1d87304bf663.tar.bz2 |
Storing memory cache slot hint inside nxt_sockaddr_t.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r-- | src/nxt_router.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index 32a3b9d3..a7842350 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -1301,6 +1301,7 @@ static void nxt_router_listen_socket_rpc_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, nxt_socket_conf_t *skcf) { + size_t size; uint32_t stream; nxt_buf_t *b; nxt_port_t *main_port, *router_port; @@ -1315,13 +1316,14 @@ nxt_router_listen_socket_rpc_create(nxt_task_t *task, rpc->socket_conf = skcf; rpc->temp_conf = tmcf; - b = nxt_buf_mem_alloc(tmcf->mem_pool, skcf->sockaddr->sockaddr_size, 0); + size = nxt_sockaddr_size(skcf->sockaddr); + + b = nxt_buf_mem_alloc(tmcf->mem_pool, size, 0); if (b == NULL) { goto fail; } - b->mem.free = nxt_cpymem(b->mem.free, skcf->sockaddr, - skcf->sockaddr->sockaddr_size); + b->mem.free = nxt_cpymem(b->mem.free, skcf->sockaddr, size); rt = task->thread->runtime; main_port = rt->port_by_type[NXT_PROCESS_MAIN]; |