comparison src/event/ngx_event_accept.c @ 50:72eb30262aac NGINX_0_1_25

nginx 0.1.25 *) Bugfix: nginx did run on Linux parisc. *) Feature: nginx now does not start under FreeBSD if the sysctl kern.ipc.somaxconn value is too big. *) Bugfix: if a request was internally redirected by the ngx_http_index_module module to the ngx_http_proxy_module or ngx_http_fastcgi_module modules, then the index file was not closed after request completion. *) Feature: the "proxy_pass" can be used in location with regular expression. *) Feature: the ngx_http_rewrite_filter_module module supports the condition like "if ($HTTP_USER_AGENT ~ MSIE)". *) Bugfix: nginx started too slow if the large number of addresses and text values were used in the "geo" directive. *) Change: a variable name must be declared as "$name" in the "geo" directive. The previous variant without "$" is still supported, but will be removed soon. *) Feature: the "%{VARIABLE}v" logging parameter. *) Feature: the "set $name value" directive. *) Bugfix: gcc 4.0 compatibility. *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
author Igor Sysoev <http://sysoev.ru>
date Sat, 19 Mar 2005 00:00:00 +0300
parents 4989c3d25945
children 0d75d65c642f
comparison
equal deleted inserted replaced
49:93dabbc9efb9 50:72eb30262aac
14 14
15 15
16 void 16 void
17 ngx_event_accept(ngx_event_t *ev) 17 ngx_event_accept(ngx_event_t *ev)
18 { 18 {
19 ngx_uint_t instance, accepted; 19 ngx_uint_t instance;
20 #if 0
21 ngx_uint_t accepted;
22 #endif
20 socklen_t len; 23 socklen_t len;
21 struct sockaddr *sa; 24 struct sockaddr *sa;
22 ngx_err_t err; 25 ngx_err_t err;
23 ngx_log_t *log; 26 ngx_log_t *log;
24 ngx_pool_t *pool; 27 ngx_pool_t *pool;
41 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, 44 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
42 "accept on %V, ready: %d", 45 "accept on %V, ready: %d",
43 &ls->listening->addr_text, ev->available); 46 &ls->listening->addr_text, ev->available);
44 47
45 ev->ready = 0; 48 ev->ready = 0;
49 pool = NULL;
50 #if 0
46 accepted = 0; 51 accepted = 0;
47 pool = NULL; 52 #endif
48 53
49 do { 54 do {
50 55
51 if (pool == NULL) { 56 if (pool == NULL) {
52 57
54 * Create the pool before accept() to avoid the copying of 59 * Create the pool before accept() to avoid the copying of
55 * the sockaddr. Although accept() can fail it is uncommon 60 * the sockaddr. Although accept() can fail it is uncommon
56 * case and besides the pool can be got from the free pool list. 61 * case and besides the pool can be got from the free pool list.
57 */ 62 */
58 63
59 if (!(pool = ngx_create_pool(ls->listening->pool_size, ev->log))) { 64 pool = ngx_create_pool(ls->listening->pool_size, ev->log);
65 if (pool == NULL) {
60 return; 66 return;
61 } 67 }
62 } 68 }
63 69
64 if (!(sa = ngx_palloc(pool, ls->listening->socklen))) { 70 sa = ngx_palloc(pool, ls->listening->socklen);
71 if (sa == NULL) {
65 ngx_destroy_pool(pool); 72 ngx_destroy_pool(pool);
66 return; 73 return;
67 } 74 }
68 75
69 if (!(log = ngx_palloc(pool, sizeof(ngx_log_t)))) { 76 log = ngx_palloc(pool, sizeof(ngx_log_t));
77 if (log == NULL) {
70 ngx_destroy_pool(pool); 78 ngx_destroy_pool(pool);
71 return; 79 return;
72 } 80 }
73 81
74 ngx_memcpy(log, ls->log, sizeof(ngx_log_t)); 82 ngx_memcpy(log, ls->log, sizeof(ngx_log_t));
329 337
330 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { 338 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
331 ev->available--; 339 ev->available--;
332 } 340 }
333 341
342 #if 0
334 accepted++; 343 accepted++;
344 #endif
335 345
336 } while (ev->available); 346 } while (ev->available);
337 } 347 }
338 348
339 349