Mercurial > hg > nginx
comparison src/core/ngx_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 | 0f203a2af17c |
children | 85dea406e18f |
comparison
equal
deleted
inserted
replaced
6378:0f203a2af17c | 6379:cf5e822cf470 |
---|---|
30 ngx_int_t | 30 ngx_int_t |
31 ngx_init_modules(ngx_cycle_t *cycle) | 31 ngx_init_modules(ngx_cycle_t *cycle) |
32 { | 32 { |
33 ngx_uint_t i; | 33 ngx_uint_t i; |
34 | 34 |
35 for (i = 0; ngx_modules[i]; i++) { | 35 for (i = 0; cycle->modules[i]; i++) { |
36 if (ngx_modules[i]->init_module) { | 36 if (cycle->modules[i]->init_module) { |
37 if (ngx_modules[i]->init_module(cycle) != NGX_OK) { | 37 if (cycle->modules[i]->init_module(cycle) != NGX_OK) { |
38 return NGX_ERROR; | 38 return NGX_ERROR; |
39 } | 39 } |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
51 | 51 |
52 max = 0; | 52 max = 0; |
53 | 53 |
54 /* count appropriate modules, set up their indices */ | 54 /* count appropriate modules, set up their indices */ |
55 | 55 |
56 for (i = 0; ngx_modules[i]; i++) { | 56 for (i = 0; cycle->modules[i]; i++) { |
57 if (ngx_modules[i]->type != type) { | 57 if (cycle->modules[i]->type != type) { |
58 continue; | 58 continue; |
59 } | 59 } |
60 | 60 |
61 ngx_modules[i]->ctx_index = max++; | 61 cycle->modules[i]->ctx_index = max++; |
62 } | 62 } |
63 | 63 |
64 return max; | 64 return max; |
65 } | 65 } |