Mercurial > hg > nginx-quic
comparison src/event/ngx_event_accept.c @ 99:a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 02 Jun 2003 15:24:30 +0000 |
parents | c9b243802a17 |
children | 7ebc8b7fb816 |
comparison
equal
deleted
inserted
replaced
98:c9b243802a17 | 99:a059e1aa65d4 |
---|---|
1 | 1 |
2 #include <ngx_config.h> | 2 #include <ngx_config.h> |
3 #include <ngx_core.h> | 3 #include <ngx_core.h> |
4 | 4 #include <ngx_event.h> |
5 #include <nginx.h> | 5 #include <nginx.h> |
6 | |
7 #include <ngx_event.h> | |
8 | 6 |
9 | 7 |
10 void ngx_event_accept(ngx_event_t *ev) | 8 void ngx_event_accept(ngx_event_t *ev) |
11 { | 9 { |
12 int instance; | 10 int instance; |
28 | 26 |
29 ev->ready = 0; | 27 ev->ready = 0; |
30 | 28 |
31 do { | 29 do { |
32 | 30 |
33 /* Create the pool before accept() to avoid copy the sockaddr. | 31 /* |
34 Although accept() can fail it's uncommon case | 32 * Create the pool before accept() to avoid copy the sockaddr. |
35 and the pool can be got from the free pool list */ | 33 * Although accept() can fail it's uncommon case |
34 * and the pool can be got from the free pool list | |
35 */ | |
36 | 36 |
37 pool = ngx_create_pool(ls->pool_size, ev->log); | 37 pool = ngx_create_pool(ls->pool_size, ev->log); |
38 if (pool == NULL) { | 38 if (pool == NULL) { |
39 return; | 39 return; |
40 } | 40 } |
166 return; | 166 return; |
167 } | 167 } |
168 ngx_memcpy(c->log, ev->log, sizeof(ngx_log_t)); | 168 ngx_memcpy(c->log, ev->log, sizeof(ngx_log_t)); |
169 rev->log = wev->log = c->log; | 169 rev->log = wev->log = c->log; |
170 | 170 |
171 /* STUB: x86: MT: lock xadd, MP: lock xadd, shared */ | 171 /* TODO: x86: MT: lock xadd, MP: lock xadd, shared */ |
172 c->number = ngx_connection_counter++; | 172 c->number = ngx_connection_counter++; |
173 | 173 |
174 ngx_log_debug(ev->log, "accept: %d, %d" _ s _ c->number); | 174 ngx_log_debug(ev->log, "accept: %d, %d" _ s _ c->number); |
175 | 175 |
176 if (ev->deferred_accept) { | 176 if (ev->deferred_accept) { |