nxt_stream_module.c (62:5e1efcc7b740) nxt_stream_module.c (65:10688b89aa16)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_runtime.h>

--- 11 unchanged lines hidden (view full) ---

20 nxt_conn_t *c;
21 nxt_runtime_t *rt;
22 nxt_upstream_peer_t *up;
23
24 c = obj;
25
26 nxt_debug(task, "stream connection init");
27
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_runtime.h>

--- 11 unchanged lines hidden (view full) ---

20 nxt_conn_t *c;
21 nxt_runtime_t *rt;
22 nxt_upstream_peer_t *up;
23
24 c = obj;
25
26 nxt_debug(task, "stream connection init");
27
28 up = nxt_mem_zalloc(c->mem_pool, sizeof(nxt_upstream_peer_t));
28 up = nxt_mp_zget(c->mem_pool, sizeof(nxt_upstream_peer_t));
29 if (nxt_slow_path(up == NULL)) {
30 goto fail;
31 }
32
33 up->data = c;
34
35 rt = task->thread->runtime;
36

--- 49 unchanged lines hidden (view full) ---

86 p->completion_handler = nxt_stream_connection_close;
87 //p->retries = 10;
88 p->peer->remote = up->sockaddr;
89
90 if (0) {
91 nxt_event_engine_t *engine;
92 nxt_event_write_rate_t *rate;
93
29 if (nxt_slow_path(up == NULL)) {
30 goto fail;
31 }
32
33 up->data = c;
34
35 rt = task->thread->runtime;
36

--- 49 unchanged lines hidden (view full) ---

86 p->completion_handler = nxt_stream_connection_close;
87 //p->retries = 10;
88 p->peer->remote = up->sockaddr;
89
90 if (0) {
91 nxt_event_engine_t *engine;
92 nxt_event_write_rate_t *rate;
93
94 rate = nxt_mem_alloc(c->mem_pool, sizeof(nxt_event_write_rate_t));
94 rate = nxt_mp_get(c->mem_pool, sizeof(nxt_event_write_rate_t));
95
96 if (nxt_slow_path(rate == NULL)) {
97 goto fail;
98 }
99
100 c->rate = rate;
101
102 rate->limit = 1024;

--- 18 unchanged lines hidden (view full) ---

121nxt_stream_connection_close(nxt_task_t *task, void *obj, void *data)
122{
123 nxt_event_conn_proxy_t *p;
124
125 p = obj;
126
127 nxt_log_debug(p->client->socket.log, "stream connection close");
128
95
96 if (nxt_slow_path(rate == NULL)) {
97 goto fail;
98 }
99
100 c->rate = rate;
101
102 rate->limit = 1024;

--- 18 unchanged lines hidden (view full) ---

121nxt_stream_connection_close(nxt_task_t *task, void *obj, void *data)
122{
123 nxt_event_conn_proxy_t *p;
124
125 p = obj;
126
127 nxt_log_debug(p->client->socket.log, "stream connection close");
128
129 nxt_mem_pool_destroy(p->client->mem_pool);
129 nxt_mp_destroy(p->client->mem_pool);
130}
130}