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

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

80 c->sendfile = NXT_CONN_SENDFILE_UNSET;
81
82 c->socket.read_work_queue = &thr->engine->fast_work_queue;
83 c->socket.write_work_queue = &thr->engine->fast_work_queue;
84
85 nxt_conn_timer_init(&c->read_timer, c, c->socket.read_work_queue);
86 nxt_conn_timer_init(&c->write_timer, c, c->socket.write_work_queue);
87
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

80 c->sendfile = NXT_CONN_SENDFILE_UNSET;
81
82 c->socket.read_work_queue = &thr->engine->fast_work_queue;
83 c->socket.write_work_queue = &thr->engine->fast_work_queue;
84
85 nxt_conn_timer_init(&c->read_timer, c, c->socket.read_work_queue);
86 nxt_conn_timer_init(&c->write_timer, c, c->socket.write_work_queue);
87
88 nxt_queue_init(&c->requests);
89
88 nxt_log_debug(&c->log, "connections: %uD", thr->engine->connections);
89
90 return c;
91}
92
93
94void
95nxt_conn_io_shutdown(nxt_task_t *task, void *obj, void *data)

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

145void
146nxt_conn_work_queue_set(nxt_conn_t *c, nxt_work_queue_t *wq)
147{
148 c->read_work_queue = wq;
149 c->write_work_queue = wq;
150 c->read_timer.work_queue = wq;
151 c->write_timer.work_queue = wq;
152}
90 nxt_log_debug(&c->log, "connections: %uD", thr->engine->connections);
91
92 return c;
93}
94
95
96void
97nxt_conn_io_shutdown(nxt_task_t *task, void *obj, void *data)

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

147void
148nxt_conn_work_queue_set(nxt_conn_t *c, nxt_work_queue_t *wq)
149{
150 c->read_work_queue = wq;
151 c->write_work_queue = wq;
152 c->read_timer.work_queue = wq;
153 c->write_timer.work_queue = wq;
154}
155
156
157nxt_req_conn_link_t *
158nxt_conn_request_add(nxt_conn_t *c, nxt_req_id_t req_id)
159{
160 nxt_req_conn_link_t *rc;
161
162 rc = nxt_mp_zalloc(c->mem_pool, sizeof(nxt_req_conn_link_t));
163 if (nxt_slow_path(rc == NULL)) {
164 nxt_thread_log_error(NXT_LOG_WARN, "failed to allocate req %08uxD "
165 "to conn", req_id);
166 return NULL;
167 }
168
169 rc->req_id = req_id;
170 rc->conn = c;
171
172 nxt_queue_insert_tail(&c->requests, &rc->link);
173
174 return rc;
175}
176
177
178void
179nxt_conn_request_remove(nxt_conn_t *c, nxt_req_conn_link_t *rc)
180{
181 nxt_queue_remove(&rc->link);
182
183 nxt_mp_free(c->mem_pool, rc);
184}
185
186