Mercurial > hg > nginx
comparison src/core/ngx_cycle.c @ 6379:cf5e822cf470
Dynamic modules: changed ngx_modules to cycle->modules.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Feb 2016 18:30:21 +0300 |
parents | 0f203a2af17c |
children | 85dea406e18f |
comparison
equal
deleted
inserted
replaced
6378:0f203a2af17c | 6379:cf5e822cf470 |
---|---|
210 } | 210 } |
211 | 211 |
212 ngx_strlow(cycle->hostname.data, (u_char *) hostname, cycle->hostname.len); | 212 ngx_strlow(cycle->hostname.data, (u_char *) hostname, cycle->hostname.len); |
213 | 213 |
214 | 214 |
215 for (i = 0; ngx_modules[i]; i++) { | 215 cycle->modules = ngx_modules; |
216 if (ngx_modules[i]->type != NGX_CORE_MODULE) { | 216 |
217 | |
218 for (i = 0; cycle->modules[i]; i++) { | |
219 if (cycle->modules[i]->type != NGX_CORE_MODULE) { | |
217 continue; | 220 continue; |
218 } | 221 } |
219 | 222 |
220 module = ngx_modules[i]->ctx; | 223 module = cycle->modules[i]->ctx; |
221 | 224 |
222 if (module->create_conf) { | 225 if (module->create_conf) { |
223 rv = module->create_conf(cycle); | 226 rv = module->create_conf(cycle); |
224 if (rv == NULL) { | 227 if (rv == NULL) { |
225 ngx_destroy_pool(pool); | 228 ngx_destroy_pool(pool); |
226 return NULL; | 229 return NULL; |
227 } | 230 } |
228 cycle->conf_ctx[ngx_modules[i]->index] = rv; | 231 cycle->conf_ctx[cycle->modules[i]->index] = rv; |
229 } | 232 } |
230 } | 233 } |
231 | 234 |
232 | 235 |
233 senv = environ; | 236 senv = environ; |
274 if (ngx_test_config && !ngx_quiet_mode) { | 277 if (ngx_test_config && !ngx_quiet_mode) { |
275 ngx_log_stderr(0, "the configuration file %s syntax is ok", | 278 ngx_log_stderr(0, "the configuration file %s syntax is ok", |
276 cycle->conf_file.data); | 279 cycle->conf_file.data); |
277 } | 280 } |
278 | 281 |
279 for (i = 0; ngx_modules[i]; i++) { | 282 for (i = 0; cycle->modules[i]; i++) { |
280 if (ngx_modules[i]->type != NGX_CORE_MODULE) { | 283 if (cycle->modules[i]->type != NGX_CORE_MODULE) { |
281 continue; | 284 continue; |
282 } | 285 } |
283 | 286 |
284 module = ngx_modules[i]->ctx; | 287 module = cycle->modules[i]->ctx; |
285 | 288 |
286 if (module->init_conf) { | 289 if (module->init_conf) { |
287 if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index]) | 290 if (module->init_conf(cycle, |
291 cycle->conf_ctx[cycle->modules[i]->index]) | |
288 == NGX_CONF_ERROR) | 292 == NGX_CONF_ERROR) |
289 { | 293 { |
290 environ = senv; | 294 environ = senv; |
291 ngx_destroy_cycle_pools(&conf); | 295 ngx_destroy_cycle_pools(&conf); |
292 return NULL; | 296 return NULL; |