Mercurial > hg > nginx
comparison src/core/ngx_conf_file.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 | 1b7e246e6b38 |
children | 2cd019520210 |
comparison
equal
deleted
inserted
replaced
6378:0f203a2af17c | 6379:cf5e822cf470 |
---|---|
327 | 327 |
328 name = cf->args->elts; | 328 name = cf->args->elts; |
329 | 329 |
330 found = 0; | 330 found = 0; |
331 | 331 |
332 for (i = 0; ngx_modules[i]; i++) { | 332 for (i = 0; cf->cycle->modules[i]; i++) { |
333 | 333 |
334 cmd = ngx_modules[i]->commands; | 334 cmd = cf->cycle->modules[i]->commands; |
335 if (cmd == NULL) { | 335 if (cmd == NULL) { |
336 continue; | 336 continue; |
337 } | 337 } |
338 | 338 |
339 for ( /* void */ ; cmd->name.len; cmd++) { | 339 for ( /* void */ ; cmd->name.len; cmd++) { |
346 continue; | 346 continue; |
347 } | 347 } |
348 | 348 |
349 found = 1; | 349 found = 1; |
350 | 350 |
351 if (ngx_modules[i]->type != NGX_CONF_MODULE | 351 if (cf->cycle->modules[i]->type != NGX_CONF_MODULE |
352 && ngx_modules[i]->type != cf->module_type) | 352 && cf->cycle->modules[i]->type != cf->module_type) |
353 { | 353 { |
354 continue; | 354 continue; |
355 } | 355 } |
356 | 356 |
357 /* is the directive's location right ? */ | 357 /* is the directive's location right ? */ |
409 /* set up the directive's configuration context */ | 409 /* set up the directive's configuration context */ |
410 | 410 |
411 conf = NULL; | 411 conf = NULL; |
412 | 412 |
413 if (cmd->type & NGX_DIRECT_CONF) { | 413 if (cmd->type & NGX_DIRECT_CONF) { |
414 conf = ((void **) cf->ctx)[ngx_modules[i]->index]; | 414 conf = ((void **) cf->ctx)[cf->cycle->modules[i]->index]; |
415 | 415 |
416 } else if (cmd->type & NGX_MAIN_CONF) { | 416 } else if (cmd->type & NGX_MAIN_CONF) { |
417 conf = &(((void **) cf->ctx)[ngx_modules[i]->index]); | 417 conf = &(((void **) cf->ctx)[cf->cycle->modules[i]->index]); |
418 | 418 |
419 } else if (cf->ctx) { | 419 } else if (cf->ctx) { |
420 confp = *(void **) ((char *) cf->ctx + cmd->conf); | 420 confp = *(void **) ((char *) cf->ctx + cmd->conf); |
421 | 421 |
422 if (confp) { | 422 if (confp) { |
423 conf = confp[ngx_modules[i]->ctx_index]; | 423 conf = confp[cf->cycle->modules[i]->ctx_index]; |
424 } | 424 } |
425 } | 425 } |
426 | 426 |
427 rv = cmd->set(cf, cmd, conf); | 427 rv = cmd->set(cf, cmd, conf); |
428 | 428 |