Mercurial > hg > nginx
comparison src/http/modules/ngx_http_rewrite_module.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 | 055d1f63960a |
children | 2cd019520210 |
comparison
equal
deleted
inserted
replaced
6378:0f203a2af17c | 6379:cf5e822cf470 |
---|---|
558 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); | 558 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); |
559 if (ctx->loc_conf == NULL) { | 559 if (ctx->loc_conf == NULL) { |
560 return NGX_CONF_ERROR; | 560 return NGX_CONF_ERROR; |
561 } | 561 } |
562 | 562 |
563 for (i = 0; ngx_modules[i]; i++) { | 563 for (i = 0; cf->cycle->modules[i]; i++) { |
564 if (ngx_modules[i]->type != NGX_HTTP_MODULE) { | 564 if (cf->cycle->modules[i]->type != NGX_HTTP_MODULE) { |
565 continue; | 565 continue; |
566 } | 566 } |
567 | 567 |
568 module = ngx_modules[i]->ctx; | 568 module = cf->cycle->modules[i]->ctx; |
569 | 569 |
570 if (module->create_loc_conf) { | 570 if (module->create_loc_conf) { |
571 | 571 |
572 mconf = module->create_loc_conf(cf); | 572 mconf = module->create_loc_conf(cf); |
573 if (mconf == NULL) { | 573 if (mconf == NULL) { |
574 return NGX_CONF_ERROR; | 574 return NGX_CONF_ERROR; |
575 } | 575 } |
576 | 576 |
577 ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf; | 577 ctx->loc_conf[cf->cycle->modules[i]->ctx_index] = mconf; |
578 } | 578 } |
579 } | 579 } |
580 | 580 |
581 pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index]; | 581 pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index]; |
582 | 582 |