aboutsummaryrefslogtreecommitdiff
path: root/src/core/nginx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r--src/core/nginx.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 8d0b3ea60..b5e4392c0 100644
--- 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_cycle_t *old_cycle, ngx_log_t *log)
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[i].fd _ file[i].name.data);
}
}
+ stub_init(cycle);
+
if (old_cycle == NULL) {
return cycle;
}