diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-03-19 12:38:37 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-03-19 12:38:37 +0000 |
commit | c15717285d2157a603bb1b130b26d7baa549be7e (patch) | |
tree | 56dc8346b22bb2660eecd3bc086d263ac6d67326 /src/core/ngx_cycle.c | |
parent | e12fbfe82a176cd386cdcecfeabf43ac8fd870a4 (diff) | |
download | nginx-release-0.1.25.tar.gz nginx-release-0.1.25.zip |
nginx-0.1.25-RELEASE importrelease-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.
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r-- | src/core/ngx_cycle.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index ad9049e4e..51864e3f7 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -54,15 +54,18 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) log = old_cycle->log; - if (!(pool = ngx_create_pool(16 * 1024, log))) { + pool = ngx_create_pool(16 * 1024, log); + if (pool == NULL) { return NULL; } pool->log = log; - if (!(cycle = ngx_pcalloc(pool, sizeof(ngx_cycle_t)))) { + cycle = ngx_pcalloc(pool, sizeof(ngx_cycle_t)); + if (cycle == NULL) { ngx_destroy_pool(pool); return NULL; } + cycle->pool = pool; cycle->log = log; cycle->old_cycle = old_cycle; @@ -72,10 +75,13 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) n = old_cycle->pathes.nelts ? old_cycle->pathes.nelts : 10; - if (!(cycle->pathes.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *)))) { + + cycle->pathes.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *)); + if (cycle->pathes.elts == NULL) { ngx_destroy_pool(pool); return NULL; } + cycle->pathes.nelts = 0; cycle->pathes.size = sizeof(ngx_path_t *); cycle->pathes.nalloc = n; @@ -100,7 +106,8 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) } - if (!(cycle->new_log = ngx_log_create_errlog(cycle, NULL))) { + cycle->new_log = ngx_log_create_errlog(cycle, NULL); + if (cycle->new_log == NULL) { ngx_destroy_pool(pool); return NULL; } @@ -109,11 +116,13 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10; + cycle->listening.elts = ngx_pcalloc(pool, n * sizeof(ngx_listening_t)); if (cycle->listening.elts == NULL) { ngx_destroy_pool(pool); return NULL; } + cycle->listening.nelts = 0; cycle->listening.size = sizeof(ngx_listening_t); cycle->listening.nalloc = n; @@ -147,7 +156,7 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) ngx_memzero(&conf, sizeof(ngx_conf_t)); /* STUB: init array ? */ - conf.args = ngx_create_array(pool, 10, sizeof(ngx_str_t)); + conf.args = ngx_array_create(pool, 10, sizeof(ngx_str_t)); if (conf.args == NULL) { ngx_destroy_pool(pool); return NULL; @@ -516,7 +525,7 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) ngx_temp_pool->log = cycle->log; - old = ngx_push_array(&ngx_old_cycles); + old = ngx_array_push(&ngx_old_cycles); if (old == NULL) { exit(1); } @@ -562,7 +571,7 @@ ngx_int_t ngx_create_pidfile(ngx_cycle_t *cycle, ngx_cycle_t *old_cycle) { ngx_uint_t trunc; size_t len; - u_char *name, pid[NGX_INT64_LEN]; + u_char pid[NGX_INT64_LEN]; ngx_file_t file; ngx_core_conf_t *ccf, *old_ccf; |