Deleted Added
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

79
80 return NULL;
81}
82
83
84static nxt_conn_t *
85nxt_conn_accept_alloc(nxt_task_t *task, nxt_listen_event_t *lev)
86{
87 nxt_mp_t *mp;
88 nxt_conn_t *c;
89 nxt_event_engine_t *engine;
90
91 engine = task->thread->engine;
92
93 if (engine->connections < engine->max_connections) {
94
95 mp = nxt_mp_create(1024, 128, 256, 32);
96
97 if (nxt_fast_path(mp != NULL)) {
98 c = nxt_conn_create(mp, lev->socket.task);
99 if (nxt_slow_path(c == NULL)) {
100 goto fail;
101 }
102
103 lev->next = c;
104 c->socket.read_work_queue = lev->socket.read_work_queue;
105 c->socket.write_ready = 1;
106 c->listen = lev;
107
108 c->remote = nxt_sockaddr_cache_alloc(engine, lev);
109 if (nxt_fast_path(c->remote != NULL)) {
110 return c;
111 }
112 }
113
114 fail:
115

--- 248 unchanged lines hidden ---