comparison src/event/modules/ngx_devpoll_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 6cfc63e68377
children b55cbf18157e
comparison
equal deleted inserted replaced
49:93dabbc9efb9 50:72eb30262aac
132 132
133 if (change_list) { 133 if (change_list) {
134 ngx_free(change_list); 134 ngx_free(change_list);
135 } 135 }
136 136
137 ngx_test_null(change_list, 137 change_list = ngx_alloc(sizeof(struct pollfd) * dpcf->changes,
138 ngx_alloc(sizeof(struct pollfd) * dpcf->changes, 138 cycle->log);
139 cycle->log), 139 if (change_list == NULL) {
140 NGX_ERROR); 140 return NGX_ERROR;
141 }
141 142
142 if (change_index) { 143 if (change_index) {
143 ngx_free(change_index); 144 ngx_free(change_index);
144 } 145 }
145 146
146 ngx_test_null(change_index, 147 change_index = ngx_alloc(sizeof(ngx_event_t *) * dpcf->changes,
147 ngx_alloc(sizeof(ngx_event_t *) * dpcf->changes, 148 cycle->log);
148 cycle->log), 149 if (change_index == NULL) {
149 NGX_ERROR); 150 return NGX_ERROR;
151 }
150 } 152 }
151 153
152 max_changes = dpcf->changes; 154 max_changes = dpcf->changes;
153 155
154 if (nevents < dpcf->events) { 156 if (nevents < dpcf->events) {
155 if (event_list) { 157 if (event_list) {
156 ngx_free(event_list); 158 ngx_free(event_list);
157 } 159 }
158 160
159 ngx_test_null(event_list, 161 event_list = ngx_alloc(sizeof(struct pollfd) * dpcf->events,
160 ngx_alloc(sizeof(struct pollfd) * dpcf->events, 162 cycle->log);
161 cycle->log), 163 if (event_list == NULL) {
162 NGX_ERROR); 164 return NGX_ERROR;
165 }
163 } 166 }
164 167
165 nevents = dpcf->events; 168 nevents = dpcf->events;
166 169
167 ngx_io = ngx_os_io; 170 ngx_io = ngx_os_io;
316 ngx_int_t 319 ngx_int_t
317 ngx_devpoll_process_events(ngx_cycle_t *cycle) 320 ngx_devpoll_process_events(ngx_cycle_t *cycle)
318 { 321 {
319 int events, revents; 322 int events, revents;
320 ngx_int_t i; 323 ngx_int_t i;
321 ngx_uint_t j, lock, accept_lock, expire; 324 ngx_uint_t lock, accept_lock, expire;
322 size_t n; 325 size_t n;
323 ngx_msec_t timer; 326 ngx_msec_t timer;
324 ngx_err_t err; 327 ngx_err_t err;
328 #if 0
325 ngx_cycle_t **old_cycle; 329 ngx_cycle_t **old_cycle;
330 #endif
326 ngx_event_t *rev, *wev; 331 ngx_event_t *rev, *wev;
327 ngx_connection_t *c; 332 ngx_connection_t *c;
328 ngx_epoch_msec_t delta; 333 ngx_epoch_msec_t delta;
329 struct dvpoll dvp; 334 struct dvpoll dvp;
330 struct timeval tv; 335 struct timeval tv;
578 static void * 583 static void *
579 ngx_devpoll_create_conf(ngx_cycle_t *cycle) 584 ngx_devpoll_create_conf(ngx_cycle_t *cycle)
580 { 585 {
581 ngx_devpoll_conf_t *dpcf; 586 ngx_devpoll_conf_t *dpcf;
582 587
583 ngx_test_null(dpcf, ngx_palloc(cycle->pool, sizeof(ngx_devpoll_conf_t)), 588 dpcf = ngx_palloc(cycle->pool, sizeof(ngx_devpoll_conf_t));
584 NGX_CONF_ERROR); 589 if (dpcf == NULL) {
590 return NGX_CONF_ERROR;
591 }
585 592
586 dpcf->changes = NGX_CONF_UNSET; 593 dpcf->changes = NGX_CONF_UNSET;
587 dpcf->events = NGX_CONF_UNSET; 594 dpcf->events = NGX_CONF_UNSET;
588 595
589 return dpcf; 596 return dpcf;