summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_sockaddr.c
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2019-11-14 19:29:00 +0300
committerAndrei Belov <defan@nginx.com>2019-11-14 19:29:00 +0300
commit7630539c44fcb188bba03a65af34e952a81f2f38 (patch)
tree2c80f0cd315cae8079a39ba98ed89e02b5e1931a /src/nxt_sockaddr.c
parent70c9f18b6e8b25850bce8eb1edba4d100c3e55d2 (diff)
parent0a27f137de776925a24406cf6961c550824c63a0 (diff)
downloadunit-7630539c44fcb188bba03a65af34e952a81f2f38.tar.gz
unit-7630539c44fcb188bba03a65af34e952a81f2f38.tar.bz2
Merged with the default branch.1.13.0-1
Diffstat (limited to 'src/nxt_sockaddr.c')
-rw-r--r--src/nxt_sockaddr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nxt_sockaddr.c b/src/nxt_sockaddr.c
index 99cf54b4..57dfbfa6 100644
--- a/src/nxt_sockaddr.c
+++ b/src/nxt_sockaddr.c
@@ -23,11 +23,11 @@ static nxt_int_t nxt_job_sockaddr_inet_parse(nxt_job_sockaddr_parse_t *jbs);
nxt_sockaddr_t *
nxt_sockaddr_cache_alloc(nxt_event_engine_t *engine, nxt_listen_socket_t *ls)
{
- uint8_t hint;
size_t size;
+ uint8_t hint;
nxt_sockaddr_t *sa;
- hint = (uint8_t) -1;
+ hint = NXT_EVENT_ENGINE_NO_MEM_HINT;
size = offsetof(nxt_sockaddr_t, u) + ls->socklen + ls->address_length;
sa = nxt_event_engine_mem_alloc(engine, &hint, size);
@@ -56,7 +56,11 @@ nxt_sockaddr_cache_alloc(nxt_event_engine_t *engine, nxt_listen_socket_t *ls)
void
nxt_sockaddr_cache_free(nxt_event_engine_t *engine, nxt_conn_t *c)
{
- nxt_event_engine_mem_free(engine, &c->remote->cache_hint, c->remote);
+ nxt_sockaddr_t *sa;
+
+ sa = c->remote;
+
+ nxt_event_engine_mem_free(engine, sa->cache_hint, sa, 0);
}