summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conn_proxy.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-06-20 19:49:17 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-06-20 19:49:17 +0300
commitf888a5310c1808902b4035ca3454b62bc5cf4434 (patch)
tree7425e11cdba27420d21468b0f79787834bd3c498 /src/nxt_conn_proxy.c
parentc7ab908c19242a5ddd0233e123e8c2be210b3c02 (diff)
downloadunit-f888a5310c1808902b4035ca3454b62bc5cf4434.tar.gz
unit-f888a5310c1808902b4035ca3454b62bc5cf4434.tar.bz2
Using new memory pool implementation.
Diffstat (limited to 'src/nxt_conn_proxy.c')
-rw-r--r--src/nxt_conn_proxy.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/nxt_conn_proxy.c b/src/nxt_conn_proxy.c
index dec23684..63a41c39 100644
--- a/src/nxt_conn_proxy.c
+++ b/src/nxt_conn_proxy.c
@@ -63,7 +63,7 @@ nxt_conn_proxy_create(nxt_conn_t *client)
nxt_thread_t *thr;
nxt_conn_proxy_t *p;
- p = nxt_mem_zalloc(client->mem_pool, sizeof(nxt_conn_proxy_t));
+ p = nxt_mp_zget(client->mem_pool, sizeof(nxt_conn_proxy_t));
if (nxt_slow_path(p == NULL)) {
return NULL;
}
@@ -152,9 +152,7 @@ nxt_conn_proxy_client_buffer_alloc(nxt_task_t *task, void *obj, void *data)
nxt_debug(task, "conn proxy client first read fd:%d", client->socket.fd);
- b = nxt_buf_mem_alloc(client->mem_pool, p->client_buffer_size,
- NXT_MEM_BUF_CUTBACK | NXT_MEM_BUF_USABLE);
-
+ b = nxt_buf_mem_alloc(client->mem_pool, p->client_buffer_size, 0);
if (nxt_slow_path(b == NULL)) {
/* An error completion. */
nxt_conn_proxy_complete(task, p);
@@ -303,9 +301,7 @@ nxt_conn_proxy_peer_read(nxt_task_t *task, void *obj, void *data)
nxt_debug(task, "conn proxy peer read fd:%d", peer->socket.fd);
- b = nxt_buf_mem_alloc(peer->mem_pool, p->peer_buffer_size,
- NXT_MEM_BUF_CUTBACK | NXT_MEM_BUF_USABLE);
-
+ b = nxt_buf_mem_alloc(peer->mem_pool, p->peer_buffer_size, 0);
if (nxt_slow_path(b == NULL)) {
/* An error completion. */
nxt_conn_proxy_complete(task, p);
@@ -894,7 +890,7 @@ nxt_conn_proxy_shutdown(nxt_task_t *task, nxt_conn_proxy_t *p,
/* Free the direction's buffer. */
b = (source == p->client) ? p->client_buffer : p->peer_buffer;
- nxt_mem_free(source->mem_pool, b);
+ nxt_mp_free(source->mem_pool, b);
}
@@ -990,8 +986,8 @@ nxt_conn_proxy_completion(nxt_task_t *task, void *obj, void *data)
p->retain--;
if (p->retain == 0) {
- nxt_mem_free(p->client->mem_pool, p->client_buffer);
- nxt_mem_free(p->client->mem_pool, p->peer_buffer);
+ nxt_mp_free(p->client->mem_pool, p->client_buffer);
+ nxt_mp_free(p->client->mem_pool, p->peer_buffer);
p->completion_handler(task, p, NULL);
}