Mercurial > hg > nginx-quic
diff src/core/nginx.c @ 190:02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 18 Nov 2003 21:34:08 +0000 |
parents | c1f3a3c7c5db |
children | 71ce40b3c37b |
line wrap: on
line diff
--- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -6,7 +6,8 @@ /* STUB */ -void stub_init(ngx_log_t *log); +void stub_init(ngx_cycle_t *cycle); + static ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle, ngx_log_t *log); @@ -97,10 +98,6 @@ int main(int argc, char *const *argv) return 1; } -#if 0 - stub_init(log); -#endif - ngx_max_module = 0; for (i = 0; ngx_modules[i]; i++) { ngx_modules[i]->index = ngx_max_module++; @@ -261,6 +258,18 @@ static ngx_cycle_t *ngx_init_cycle(ngx_c cycle->old_cycle = old_cycle; + n = old_cycle ? old_cycle->pathes.nelts : 10; + 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; + cycle->pathes.pool = pool; + + n = old_cycle ? old_cycle->open_files.nelts : 20; cycle->open_files.elts = ngx_pcalloc(pool, n * sizeof(ngx_open_file_t)); if (cycle->open_files.elts == NULL) { @@ -455,6 +464,8 @@ ngx_log_debug(log, "OPEN: %d:%s" _ file[ } } + stub_init(cycle); + if (old_cycle == NULL) { return cycle; }