comparison src/http/ngx_http_upstream.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 b31928ca3870
children ad3f342f14ba
comparison
equal deleted inserted replaced
6378:0f203a2af17c 6379:cf5e822cf470
5329 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); 5329 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
5330 if (ctx->loc_conf == NULL) { 5330 if (ctx->loc_conf == NULL) {
5331 return NGX_CONF_ERROR; 5331 return NGX_CONF_ERROR;
5332 } 5332 }
5333 5333
5334 for (m = 0; ngx_modules[m]; m++) { 5334 for (m = 0; cf->cycle->modules[m]; m++) {
5335 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { 5335 if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
5336 continue; 5336 continue;
5337 } 5337 }
5338 5338
5339 module = ngx_modules[m]->ctx; 5339 module = cf->cycle->modules[m]->ctx;
5340 5340
5341 if (module->create_srv_conf) { 5341 if (module->create_srv_conf) {
5342 mconf = module->create_srv_conf(cf); 5342 mconf = module->create_srv_conf(cf);
5343 if (mconf == NULL) { 5343 if (mconf == NULL) {
5344 return NGX_CONF_ERROR; 5344 return NGX_CONF_ERROR;
5345 } 5345 }
5346 5346
5347 ctx->srv_conf[ngx_modules[m]->ctx_index] = mconf; 5347 ctx->srv_conf[cf->cycle->modules[m]->ctx_index] = mconf;
5348 } 5348 }
5349 5349
5350 if (module->create_loc_conf) { 5350 if (module->create_loc_conf) {
5351 mconf = module->create_loc_conf(cf); 5351 mconf = module->create_loc_conf(cf);
5352 if (mconf == NULL) { 5352 if (mconf == NULL) {
5353 return NGX_CONF_ERROR; 5353 return NGX_CONF_ERROR;
5354 } 5354 }
5355 5355
5356 ctx->loc_conf[ngx_modules[m]->ctx_index] = mconf; 5356 ctx->loc_conf[cf->cycle->modules[m]->ctx_index] = mconf;
5357 } 5357 }
5358 } 5358 }
5359 5359
5360 uscf->servers = ngx_array_create(cf->pool, 4, 5360 uscf->servers = ngx_array_create(cf->pool, 4,
5361 sizeof(ngx_http_upstream_server_t)); 5361 sizeof(ngx_http_upstream_server_t));