summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-10-17 16:22:38 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-10-17 16:22:38 +0300
commit09ef66d39c277ed709e2333f992b1d87304bf663 (patch)
tree980e60508cb4c86b2a6637616001d10eaeb8f393 /src/nxt_router.c
parent1c6d4d8cff1f9c2da56ce6cc433c17b2d69fca2b (diff)
downloadunit-09ef66d39c277ed709e2333f992b1d87304bf663.tar.gz
unit-09ef66d39c277ed709e2333f992b1d87304bf663.tar.bz2
Storing memory cache slot hint inside nxt_sockaddr_t.
Diffstat (limited to '')
-rw-r--r--src/nxt_router.c8
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];