comparison src/event/modules/ngx_select_module.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 a39d1b793287
children b55cbf18157e
comparison
equal deleted inserted replaced
49:93dabbc9efb9 50:72eb30262aac
70 NULL, /* init module */ 70 NULL, /* init module */
71 NULL /* init process */ 71 NULL /* init process */
72 }; 72 };
73 73
74 74
75 static ngx_int_t ngx_select_init(ngx_cycle_t *cycle) 75 static ngx_int_t
76 ngx_select_init(ngx_cycle_t *cycle)
76 { 77 {
77 ngx_event_t **index; 78 ngx_event_t **index;
78 79
79 if (event_index == NULL) { 80 if (event_index == NULL) {
80 FD_ZERO(&master_read_fd_set); 81 FD_ZERO(&master_read_fd_set);
84 85
85 if (ngx_process == NGX_PROCESS_WORKER 86 if (ngx_process == NGX_PROCESS_WORKER
86 || cycle->old_cycle == NULL 87 || cycle->old_cycle == NULL
87 || cycle->old_cycle->connection_n < cycle->connection_n) 88 || cycle->old_cycle->connection_n < cycle->connection_n)
88 { 89 {
89 ngx_test_null(index, 90 index = ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
90 ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n, 91 cycle->log);
91 cycle->log), 92 if (index == NULL) {
92 NGX_ERROR); 93 return NGX_ERROR;
94 }
93 95
94 if (event_index) { 96 if (event_index) {
95 ngx_memcpy(index, event_index, sizeof(ngx_event_t *) * nevents); 97 ngx_memcpy(index, event_index, sizeof(ngx_event_t *) * nevents);
96 ngx_free(event_index); 98 ngx_free(event_index);
97 } 99 }
99 101
100 #if 0 102 #if 0
101 if (ready_index) { 103 if (ready_index) {
102 ngx_free(ready_index); 104 ngx_free(ready_index);
103 } 105 }
104 ngx_test_null(ready_index, 106
105 ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n, 107 ready_index = ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
106 cycle->log), 108 cycle->log);
107 NGX_ERROR); 109 if (ready_index == NULL) {
110 return NGX_ERROR;
111 }
108 #endif 112 #endif
109 } 113 }
110 114
111 ngx_io = ngx_os_io; 115 ngx_io = ngx_os_io;
112 116
122 126
123 return NGX_OK; 127 return NGX_OK;
124 } 128 }
125 129
126 130
127 static void ngx_select_done(ngx_cycle_t *cycle) 131 static void
132 ngx_select_done(ngx_cycle_t *cycle)
128 { 133 {
129 ngx_free(event_index); 134 ngx_free(event_index);
130 #if 0 135 #if 0
131 ngx_free(ready_index); 136 ngx_free(ready_index);
132 #endif 137 #endif
133 138
134 event_index = NULL; 139 event_index = NULL;
135 } 140 }
136 141
137 142
138 static ngx_int_t ngx_select_add_event(ngx_event_t *ev, int event, u_int flags) 143 static ngx_int_t
144 ngx_select_add_event(ngx_event_t *ev, int event, u_int flags)
139 { 145 {
140 ngx_connection_t *c; 146 ngx_connection_t *c;
141 147
142 c = ev->data; 148 c = ev->data;
143 149
194 200
195 return NGX_OK; 201 return NGX_OK;
196 } 202 }
197 203
198 204
199 static ngx_int_t ngx_select_del_event(ngx_event_t *ev, int event, u_int flags) 205 static ngx_int_t
206 ngx_select_del_event(ngx_event_t *ev, int event, u_int flags)
200 { 207 {
201 ngx_connection_t *c; 208 ngx_connection_t *c;
202 209
203 c = ev->data; 210 c = ev->data;
204 211
246 253
247 return NGX_OK; 254 return NGX_OK;
248 } 255 }
249 256
250 257
251 static ngx_int_t ngx_select_process_events(ngx_cycle_t *cycle) 258 static ngx_int_t
259 ngx_select_process_events(ngx_cycle_t *cycle)
252 { 260 {
253 int ready, nready; 261 int ready, nready;
254 ngx_uint_t i, found, lock, expire; 262 ngx_uint_t i, found, lock, expire;
255 ngx_err_t err; 263 ngx_err_t err;
256 ngx_msec_t timer; 264 ngx_msec_t timer;
590 598
591 return NGX_OK; 599 return NGX_OK;
592 } 600 }
593 601
594 602
595 static char *ngx_select_init_conf(ngx_cycle_t *cycle, void *conf) 603 static char *
604 ngx_select_init_conf(ngx_cycle_t *cycle, void *conf)
596 { 605 {
597 ngx_event_conf_t *ecf; 606 ngx_event_conf_t *ecf;
598 607
599 ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module); 608 ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module);
600 609