blob: d1942d581e31a8030802c23e52fb6fa665131889 [file] [log] [blame]
Igor Sysoev6de5c2c2002-08-06 16:39:45 +00001
2#include <ngx_config.h>
Igor Sysoev0ad17c02002-08-26 15:18:19 +00003#include <ngx_core.h>
Igor Sysoev6de5c2c2002-08-06 16:39:45 +00004#include <ngx_event.h>
Igor Sysoev7578ec92003-06-02 15:24:30 +00005#include <nginx.h>
Igor Sysoev6de5c2c2002-08-06 16:39:45 +00006
7
Igor Sysoev54498db2004-02-11 17:08:49 +00008typedef struct {
Igor Sysoev10a543a2004-03-16 07:10:12 +00009 int flag;
10 u_char *name;
Igor Sysoev54498db2004-02-11 17:08:49 +000011} ngx_accept_log_ctx_t;
12
13
Igor Sysoev160d7742003-11-19 16:26:41 +000014static size_t ngx_accept_log_error(void *data, char *buf, size_t len);
15
16
Igor Sysoev205dc142004-04-01 06:21:13 +000017ngx_atomic_t *ngx_accept_mutex_ptr;
Igor Sysoev709405b2004-03-31 15:26:46 +000018ngx_atomic_t *ngx_accept_mutex;
Igor Sysoev205dc142004-04-01 06:21:13 +000019ngx_uint_t ngx_accept_mutex_held;
Igor Sysoev709405b2004-03-31 15:26:46 +000020
21
Igor Sysoevd581fd52003-05-13 16:02:32 +000022void ngx_event_accept(ngx_event_t *ev)
Igor Sysoev6de5c2c2002-08-06 16:39:45 +000023{
Igor Sysoev709405b2004-03-31 15:26:46 +000024 ngx_uint_t instance, rinstance, winstance, accepted;
Igor Sysoev160d7742003-11-19 16:26:41 +000025 socklen_t len;
26 struct sockaddr *sa;
27 ngx_err_t err;
28 ngx_log_t *log;
29 ngx_pool_t *pool;
30 ngx_socket_t s;
31 ngx_event_t *rev, *wev;
32 ngx_connection_t *c, *ls;
33 ngx_event_conf_t *ecf;
Igor Sysoev54498db2004-02-11 17:08:49 +000034 ngx_accept_log_ctx_t *ctx;
Igor Sysoev42feecb2002-12-15 06:25:09 +000035
Igor Sysoev9d639522003-07-07 06:11:50 +000036 ecf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_event_core_module);
Igor Sysoev13933252003-05-29 13:02:09 +000037
Igor Sysoeva4b16df2004-02-02 21:19:52 +000038 if (ngx_event_flags & (NGX_USE_EDGE_EVENT|NGX_USE_SIGIO_EVENT)) {
39 ev->available = 1;
40
41 } else if (!(ngx_event_flags & NGX_HAVE_KQUEUE_EVENT)) {
42 ev->available = ecf->multi_accept;
43 }
44
Igor Sysoev13933252003-05-29 13:02:09 +000045 ls = ev->data;
Igor Sysoev86de4cb2003-01-30 07:28:09 +000046
Igor Sysoev54498db2004-02-11 17:08:49 +000047 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
48 "accept on %s, ready: %d",
49 ls->listening->addr_text.data, ev->available);
Igor Sysoev86de4cb2003-01-30 07:28:09 +000050
Igor Sysoev6de5c2c2002-08-06 16:39:45 +000051 ev->ready = 0;
Igor Sysoev160d7742003-11-19 16:26:41 +000052 accepted = 0;
Igor Sysoeva4b16df2004-02-02 21:19:52 +000053 pool = NULL;
Igor Sysoev86de4cb2003-01-30 07:28:09 +000054
Igor Sysoev6de5c2c2002-08-06 16:39:45 +000055 do {
Igor Sysoev1c13c662003-05-20 15:37:55 +000056
Igor Sysoeva4b16df2004-02-02 21:19:52 +000057 if (pool == NULL) {
Igor Sysoev1c13c662003-05-20 15:37:55 +000058
Igor Sysoeva4b16df2004-02-02 21:19:52 +000059 /*
60 * Create the pool before accept() to avoid copy the sockaddr.
61 * Although accept() can fail it's an uncommon case
62 * and besides the pool can be got from the free pool list
63 */
64
65 if (!(pool = ngx_create_pool(ls->listening->pool_size, ev->log))) {
66 return;
67 }
Igor Sysoevd581fd52003-05-13 16:02:32 +000068 }
Igor Sysoev86de4cb2003-01-30 07:28:09 +000069
Igor Sysoev160d7742003-11-19 16:26:41 +000070 if (!(sa = ngx_palloc(pool, ls->listening->socklen))) {
Igor Sysoeva4b16df2004-02-02 21:19:52 +000071 ngx_destroy_pool(pool);
Igor Sysoevd581fd52003-05-13 16:02:32 +000072 return;
73 }
74
Igor Sysoev160d7742003-11-19 16:26:41 +000075 if (!(log = ngx_palloc(pool, sizeof(ngx_log_t)))) {
Igor Sysoeva4b16df2004-02-02 21:19:52 +000076 ngx_destroy_pool(pool);
Igor Sysoev160d7742003-11-19 16:26:41 +000077 return;
78 }
Igor Sysoeva4b16df2004-02-02 21:19:52 +000079
Igor Sysoev160d7742003-11-19 16:26:41 +000080 ngx_memcpy(log, ls->log, sizeof(ngx_log_t));
81 pool->log = log;
82
Igor Sysoev54498db2004-02-11 17:08:49 +000083 if (!(ctx = ngx_palloc(pool, sizeof(ngx_accept_log_ctx_t)))) {
84 ngx_destroy_pool(pool);
85 return;
86 }
87
88 /* -1 disable logging the connection number */
89 ctx->flag = -1;
90 ctx->name = ls->listening->addr_text.data;
91
92 log->data = ctx;
Igor Sysoev160d7742003-11-19 16:26:41 +000093 log->handler = ngx_accept_log_error;
94
Igor Sysoev239baac2003-06-11 15:28:34 +000095 len = ls->listening->socklen;
96
Igor Sysoev86de4cb2003-01-30 07:28:09 +000097 s = accept(ls->fd, sa, &len);
98 if (s == -1) {
Igor Sysoev6de5c2c2002-08-06 16:39:45 +000099 err = ngx_socket_errno;
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000100
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000101 if (err == NGX_EAGAIN) {
Igor Sysoev9139cd22004-02-17 17:53:12 +0000102 if (!(ngx_event_flags
103 & (NGX_USE_EDGE_EVENT|NGX_USE_SIGIO_EVENT)))
104 {
105 ngx_log_error(NGX_LOG_NOTICE, log, err,
106 "EAGAIN after %d accepted connection(s)",
107 accepted);
108 }
Igor Sysoeva4b16df2004-02-02 21:19:52 +0000109
110 ngx_destroy_pool(pool);
Igor Sysoevd581fd52003-05-13 16:02:32 +0000111 return;
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000112 }
Igor Sysoev0ad17c02002-08-26 15:18:19 +0000113
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000114 ngx_log_error(NGX_LOG_ALERT, ev->log, err,
Igor Sysoev160d7742003-11-19 16:26:41 +0000115 "accept() on %s failed",
116 ls->listening->addr_text.data);
Igor Sysoev13933252003-05-29 13:02:09 +0000117
Igor Sysoeva4b16df2004-02-02 21:19:52 +0000118 if (err == NGX_ECONNABORTED) {
119 if (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT) {
120 ev->available--;
121 }
122
123 if (ev->available) {
124 /* reuse the previously allocated pool */
125 continue;
126 }
127 }
128
Igor Sysoev13933252003-05-29 13:02:09 +0000129 ngx_destroy_pool(pool);
130 return;
131 }
132
Igor Sysoev72f2e362003-07-22 19:53:10 +0000133 /* disable warning: Win32 SOCKET is u_int while UNIX socket is int */
Igor Sysoev890fc962003-07-20 21:15:59 +0000134
Igor Sysoevaa3436c2003-05-30 14:27:59 +0000135 if ((unsigned) s >= (unsigned) ecf->connections) {
Igor Sysoev13933252003-05-29 13:02:09 +0000136
137 ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
Igor Sysoev160d7742003-11-19 16:26:41 +0000138 "accept() on %s returned socket #%d while "
Igor Sysoev13933252003-05-29 13:02:09 +0000139 "only %d connections was configured, "
Igor Sysoevbb6ec8c2003-11-20 07:05:50 +0000140 "closing the connection",
Igor Sysoev239baac2003-06-11 15:28:34 +0000141 ls->listening->addr_text.data, s, ecf->connections);
Igor Sysoev13933252003-05-29 13:02:09 +0000142
143 if (ngx_close_socket(s) == -1) {
Igor Sysoev160d7742003-11-19 16:26:41 +0000144 ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno,
145 ngx_close_socket_n "failed");
Igor Sysoev13933252003-05-29 13:02:09 +0000146 }
147
Igor Sysoevbb6ec8c2003-11-20 07:05:50 +0000148 /* TODO: disable temporary accept() event */
Igor Sysoev13933252003-05-29 13:02:09 +0000149
150 ngx_destroy_pool(pool);
Igor Sysoevd581fd52003-05-13 16:02:32 +0000151 return;
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000152 }
Igor Sysoev0ad17c02002-08-26 15:18:19 +0000153
Igor Sysoev7b6062a2004-02-12 20:57:10 +0000154 /* set a blocking mode for aio and non-blocking mode for the others */
Igor Sysoev73009772003-02-06 17:21:13 +0000155
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000156 if (ngx_inherited_nonblocking) {
157 if ((ngx_event_flags & NGX_USE_AIO_EVENT)) {
158 if (ngx_blocking(s) == -1) {
Igor Sysoev160d7742003-11-19 16:26:41 +0000159 ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno,
160 ngx_blocking_n " failed");
Igor Sysoev13933252003-05-29 13:02:09 +0000161
162 if (ngx_close_socket(s) == -1) {
Igor Sysoev160d7742003-11-19 16:26:41 +0000163 ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno,
164 ngx_close_socket_n " failed");
Igor Sysoev13933252003-05-29 13:02:09 +0000165 }
166
167 ngx_destroy_pool(pool);
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000168 return;
169 }
170 }
Igor Sysoev73009772003-02-06 17:21:13 +0000171
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000172 } else {
Igor Sysoev7af6b162004-02-09 07:46:43 +0000173 if (!(ngx_event_flags & NGX_USE_AIO_EVENT)) {
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000174 if (ngx_nonblocking(s) == -1) {
Igor Sysoev160d7742003-11-19 16:26:41 +0000175 ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno,
176 ngx_nonblocking_n " failed");
Igor Sysoev13933252003-05-29 13:02:09 +0000177
178 if (ngx_close_socket(s) == -1) {
Igor Sysoev160d7742003-11-19 16:26:41 +0000179 ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno,
180 ngx_close_socket_n " failed");
Igor Sysoev13933252003-05-29 13:02:09 +0000181 }
182
183 ngx_destroy_pool(pool);
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000184 return;
185 }
Igor Sysoev73009772003-02-06 17:21:13 +0000186 }
187 }
Igor Sysoev73009772003-02-06 17:21:13 +0000188
Igor Sysoev239baac2003-06-11 15:28:34 +0000189#if (WIN32)
190 /*
191 * Winsock assignes a socket number divisible by 4
192 * so to find a connection we divide a socket number by 4.
193 */
194
195 if (s % 4) {
Igor Sysoev160d7742003-11-19 16:26:41 +0000196 ngx_log_error(NGX_LOG_EMERG, ev->log, 0,
197 "accept() on %s returned socket #%d, "
198 "not divisible by 4",
199 ls->listening->addr_text.data, s);
Igor Sysoev239baac2003-06-11 15:28:34 +0000200 exit(1);
201 }
202
Igor Sysoev9d639522003-07-07 06:11:50 +0000203 c = &ngx_cycle->connections[s / 4];
204 rev = &ngx_cycle->read_events[s / 4];
205 wev = &ngx_cycle->write_events[s / 4];
Igor Sysoev239baac2003-06-11 15:28:34 +0000206#else
Igor Sysoev9d639522003-07-07 06:11:50 +0000207 c = &ngx_cycle->connections[s];
208 rev = &ngx_cycle->read_events[s];
209 wev = &ngx_cycle->write_events[s];
Igor Sysoev239baac2003-06-11 15:28:34 +0000210#endif
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000211
Igor Sysoev6b863e32003-05-12 15:52:24 +0000212 instance = rev->instance;
Igor Sysoev709405b2004-03-31 15:26:46 +0000213 rinstance = rev->returned_instance;
214 winstance = wev->returned_instance;
Igor Sysoev6b863e32003-05-12 15:52:24 +0000215
Igor Sysoev42feecb2002-12-15 06:25:09 +0000216 ngx_memzero(rev, sizeof(ngx_event_t));
217 ngx_memzero(wev, sizeof(ngx_event_t));
218 ngx_memzero(c, sizeof(ngx_connection_t));
Igor Sysoev0ad17c02002-08-26 15:18:19 +0000219
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000220 c->pool = pool;
221
Igor Sysoev239baac2003-06-11 15:28:34 +0000222 c->listening = ls->listening;
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000223 c->sockaddr = sa;
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000224 c->socklen = len;
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000225
Igor Sysoev10a543a2004-03-16 07:10:12 +0000226 rev->instance = (u_char) !instance;
Igor Sysoev709405b2004-03-31 15:26:46 +0000227 rev->returned_instance = (u_char) rinstance;
228
Igor Sysoev10a543a2004-03-16 07:10:12 +0000229 wev->instance = (u_char) !instance;
Igor Sysoev709405b2004-03-31 15:26:46 +0000230 wev->returned_instance = (u_char) winstance;
Igor Sysoev6b863e32003-05-12 15:52:24 +0000231
Igor Sysoev160d7742003-11-19 16:26:41 +0000232 rev->index = NGX_INVALID_INDEX;
233 wev->index = NGX_INVALID_INDEX;
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000234
Igor Sysoev160d7742003-11-19 16:26:41 +0000235 rev->data = c;
236 wev->data = c;
237
Igor Sysoev42feecb2002-12-15 06:25:09 +0000238 c->read = rev;
239 c->write = wev;
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000240
Igor Sysoev42feecb2002-12-15 06:25:09 +0000241 c->fd = s;
242 c->unexpected_eof = 1;
Igor Sysoev160d7742003-11-19 16:26:41 +0000243
Igor Sysoev42feecb2002-12-15 06:25:09 +0000244 wev->write = 1;
Igor Sysoevb5faed22003-10-29 08:30:44 +0000245 wev->ready = 1;
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000246
Igor Sysoeva4b16df2004-02-02 21:19:52 +0000247 if (ngx_event_flags
248 & (NGX_USE_AIO_EVENT|NGX_USE_EDGE_EVENT|NGX_USE_SIGIO_EVENT))
249 {
250 /* aio, iocp, sigio, epoll */
Igor Sysoevb5faed22003-10-29 08:30:44 +0000251 rev->ready = 1;
Igor Sysoev73009772003-02-06 17:21:13 +0000252 }
Igor Sysoev73009772003-02-06 17:21:13 +0000253
Igor Sysoev10318a22004-01-29 21:45:01 +0000254 if (ev->deferred_accept) {
255 rev->ready = 1;
256 }
257
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000258 c->ctx = ls->ctx;
259 c->servers = ls->servers;
Igor Sysoev42feecb2002-12-15 06:25:09 +0000260
Igor Sysoev160d7742003-11-19 16:26:41 +0000261 c->log = log;
262 rev->log = log;
263 wev->log = log;
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000264
Igor Sysoev5f800782003-12-08 20:48:12 +0000265 /*
Igor Sysoev54498db2004-02-11 17:08:49 +0000266 * TODO: MT: - atomic increment (x86: lock xadd)
Igor Sysoevb54698b2004-02-23 20:57:12 +0000267 * or protection by critical section or light mutex
Igor Sysoev5f800782003-12-08 20:48:12 +0000268 *
269 * TODO: MP: - allocated in a shared memory
270 * - atomic increment (x86: lock xadd)
Igor Sysoevb54698b2004-02-23 20:57:12 +0000271 * or protection by critical section or light mutex
Igor Sysoev5f800782003-12-08 20:48:12 +0000272 */
Igor Sysoeve89c4582003-12-19 08:15:11 +0000273
Igor Sysoevb54698b2004-02-23 20:57:12 +0000274 c->number = ngx_atomic_inc(&ngx_connection_counter);
Igor Sysoev42feecb2002-12-15 06:25:09 +0000275
Igor Sysoevd8e1f072004-01-22 06:47:28 +0000276 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
Igor Sysoevb54698b2004-02-23 20:57:12 +0000277 "accept: fd:%d c:%d", s, c->number);
Igor Sysoev0ad17c02002-08-26 15:18:19 +0000278
Igor Sysoev13933252003-05-29 13:02:09 +0000279 if (ngx_add_conn) {
280 if (ngx_add_conn(c) == NGX_ERROR) {
281 if (ngx_close_socket(s) == -1) {
282 ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
Igor Sysoev160d7742003-11-19 16:26:41 +0000283 ngx_close_socket_n " failed");
Igor Sysoev13933252003-05-29 13:02:09 +0000284 }
Igor Sysoev6a644c62003-03-04 06:33:48 +0000285
Igor Sysoev13933252003-05-29 13:02:09 +0000286 ngx_destroy_pool(pool);
Igor Sysoevd581fd52003-05-13 16:02:32 +0000287 return;
Igor Sysoev6a644c62003-03-04 06:33:48 +0000288 }
289 }
290
Igor Sysoeva4b16df2004-02-02 21:19:52 +0000291 pool = NULL;
292
Igor Sysoev160d7742003-11-19 16:26:41 +0000293 log->data = NULL;
294 log->handler = NULL;
295
Igor Sysoev239baac2003-06-11 15:28:34 +0000296 ls->listening->handler(c);
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000297
Igor Sysoeva9830112003-05-19 16:39:14 +0000298 if (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT) {
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000299 ev->available--;
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000300 }
Igor Sysoev160d7742003-11-19 16:26:41 +0000301
302 accepted++;
Igor Sysoev86de4cb2003-01-30 07:28:09 +0000303
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000304 } while (ev->available);
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000305}
Igor Sysoev160d7742003-11-19 16:26:41 +0000306
307
Igor Sysoev709405b2004-03-31 15:26:46 +0000308ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle)
309{
310 if (*ngx_accept_mutex == 0 && ngx_atomic_cmp_set(ngx_accept_mutex, 0, 1)) {
311
312 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
313 "accept mutex locked");
314
Igor Sysoev205dc142004-04-01 06:21:13 +0000315 if (!ngx_accept_mutex_held) {
Igor Sysoev709405b2004-03-31 15:26:46 +0000316 if (ngx_enable_accept_events(cycle) == NGX_ERROR) {
Igor Sysoev205dc142004-04-01 06:21:13 +0000317 *ngx_accept_mutex = 0;
Igor Sysoev709405b2004-03-31 15:26:46 +0000318 return NGX_ERROR;
319 }
320
Igor Sysoev205dc142004-04-01 06:21:13 +0000321 ngx_accept_mutex_held = 1;
Igor Sysoev709405b2004-03-31 15:26:46 +0000322 }
323
324 return NGX_OK;
325 }
326
Igor Sysoev205dc142004-04-01 06:21:13 +0000327 if (ngx_accept_mutex_held) {
Igor Sysoev709405b2004-03-31 15:26:46 +0000328 if (ngx_disable_accept_events(cycle) == NGX_ERROR) {
329 return NGX_ERROR;
330 }
331
Igor Sysoev205dc142004-04-01 06:21:13 +0000332 ngx_accept_mutex_held = 0;
Igor Sysoev709405b2004-03-31 15:26:46 +0000333 }
334
335 return NGX_OK;
336}
337
338
339ngx_int_t ngx_enable_accept_events(ngx_cycle_t *cycle)
340{
341 ngx_uint_t i;
342 ngx_listening_t *s;
343
344 s = cycle->listening.elts;
345 for (i = 0; i < cycle->listening.nelts; i++) {
346
347 /*
348 * we do not need to handle the Winsock sockets here (divde a socket
349 * number by 4) because this function would never called
350 * in the Winsock environment
351 */
352
353 if (ngx_event_flags & NGX_USE_SIGIO_EVENT) {
354 if (ngx_add_conn(&cycle->connections[s[i].fd]) == NGX_ERROR) {
355 return NGX_ERROR;
356 }
357
358 } else {
359 if (ngx_add_event(&cycle->read_events[s[i].fd], NGX_READ_EVENT, 0)
360 == NGX_ERROR)
361 {
362 return NGX_ERROR;
363 }
364 }
365 }
366
367 return NGX_OK;
368}
369
370
371ngx_int_t ngx_disable_accept_events(ngx_cycle_t *cycle)
372{
373 ngx_uint_t i;
374 ngx_listening_t *s;
375
376 s = cycle->listening.elts;
377 for (i = 0; i < cycle->listening.nelts; i++) {
378
379 /*
380 * we do not need to handle the Winsock sockets here (divde a socket
381 * number by 4) because this function would never called
382 * in the Winsock environment
383 */
384
385 if (ngx_event_flags & NGX_USE_SIGIO_EVENT) {
386 if (ngx_del_conn(&cycle->connections[s[i].fd], NGX_DISABLE_EVENT)
387 == NGX_ERROR)
388 {
389 return NGX_ERROR;
390 }
391
392 } else {
393 if (ngx_del_event(&cycle->read_events[s[i].fd], NGX_READ_EVENT,
394 NGX_DISABLE_EVENT) == NGX_ERROR)
395 {
396 return NGX_ERROR;
397 }
398 }
399 }
400
401 return NGX_OK;
402}
403
404
Igor Sysoev160d7742003-11-19 16:26:41 +0000405static size_t ngx_accept_log_error(void *data, char *buf, size_t len)
406{
Igor Sysoev54498db2004-02-11 17:08:49 +0000407 ngx_accept_log_ctx_t *ctx = data;
Igor Sysoev160d7742003-11-19 16:26:41 +0000408
Igor Sysoev54498db2004-02-11 17:08:49 +0000409 return ngx_snprintf(buf, len, " while accept() on %s", ctx->name);
Igor Sysoev160d7742003-11-19 16:26:41 +0000410}