comparison src/http/ngx_http.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 6f8254ae61b8
comparison
equal deleted inserted replaced
6378:0f203a2af17c 6379:cf5e822cf470
181 /* 181 /*
182 * create the main_conf's, the null srv_conf's, and the null loc_conf's 182 * create the main_conf's, the null srv_conf's, and the null loc_conf's
183 * of the all http modules 183 * of the all http modules
184 */ 184 */
185 185
186 for (m = 0; ngx_modules[m]; m++) { 186 for (m = 0; cf->cycle->modules[m]; m++) {
187 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { 187 if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
188 continue; 188 continue;
189 } 189 }
190 190
191 module = ngx_modules[m]->ctx; 191 module = cf->cycle->modules[m]->ctx;
192 mi = ngx_modules[m]->ctx_index; 192 mi = cf->cycle->modules[m]->ctx_index;
193 193
194 if (module->create_main_conf) { 194 if (module->create_main_conf) {
195 ctx->main_conf[mi] = module->create_main_conf(cf); 195 ctx->main_conf[mi] = module->create_main_conf(cf);
196 if (ctx->main_conf[mi] == NULL) { 196 if (ctx->main_conf[mi] == NULL) {
197 return NGX_CONF_ERROR; 197 return NGX_CONF_ERROR;
214 } 214 }
215 215
216 pcf = *cf; 216 pcf = *cf;
217 cf->ctx = ctx; 217 cf->ctx = ctx;
218 218
219 for (m = 0; ngx_modules[m]; m++) { 219 for (m = 0; cf->cycle->modules[m]; m++) {
220 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { 220 if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
221 continue; 221 continue;
222 } 222 }
223 223
224 module = ngx_modules[m]->ctx; 224 module = cf->cycle->modules[m]->ctx;
225 225
226 if (module->preconfiguration) { 226 if (module->preconfiguration) {
227 if (module->preconfiguration(cf) != NGX_OK) { 227 if (module->preconfiguration(cf) != NGX_OK) {
228 return NGX_CONF_ERROR; 228 return NGX_CONF_ERROR;
229 } 229 }
246 */ 246 */
247 247
248 cmcf = ctx->main_conf[ngx_http_core_module.ctx_index]; 248 cmcf = ctx->main_conf[ngx_http_core_module.ctx_index];
249 cscfp = cmcf->servers.elts; 249 cscfp = cmcf->servers.elts;
250 250
251 for (m = 0; ngx_modules[m]; m++) { 251 for (m = 0; cf->cycle->modules[m]; m++) {
252 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { 252 if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
253 continue; 253 continue;
254 } 254 }
255 255
256 module = ngx_modules[m]->ctx; 256 module = cf->cycle->modules[m]->ctx;
257 mi = ngx_modules[m]->ctx_index; 257 mi = cf->cycle->modules[m]->ctx_index;
258 258
259 /* init http{} main_conf's */ 259 /* init http{} main_conf's */
260 260
261 if (module->init_main_conf) { 261 if (module->init_main_conf) {
262 rv = module->init_main_conf(cf, ctx->main_conf[mi]); 262 rv = module->init_main_conf(cf, ctx->main_conf[mi]);
295 if (ngx_http_init_headers_in_hash(cf, cmcf) != NGX_OK) { 295 if (ngx_http_init_headers_in_hash(cf, cmcf) != NGX_OK) {
296 return NGX_CONF_ERROR; 296 return NGX_CONF_ERROR;
297 } 297 }
298 298
299 299
300 for (m = 0; ngx_modules[m]; m++) { 300 for (m = 0; cf->cycle->modules[m]; m++) {
301 if (ngx_modules[m]->type != NGX_HTTP_MODULE) { 301 if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
302 continue; 302 continue;
303 } 303 }
304 304
305 module = ngx_modules[m]->ctx; 305 module = cf->cycle->modules[m]->ctx;
306 306
307 if (module->postconfiguration) { 307 if (module->postconfiguration) {
308 if (module->postconfiguration(cf) != NGX_OK) { 308 if (module->postconfiguration(cf) != NGX_OK) {
309 return NGX_CONF_ERROR; 309 return NGX_CONF_ERROR;
310 } 310 }