Mercurial > hg > nginx
comparison src/stream/ngx_stream.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 | 8f038068f4bc |
comparison
equal
deleted
inserted
replaced
6378:0f203a2af17c | 6379:cf5e822cf470 |
---|---|
117 | 117 |
118 /* | 118 /* |
119 * create the main_conf's and the null srv_conf's of the all stream modules | 119 * create the main_conf's and the null srv_conf's of the all stream modules |
120 */ | 120 */ |
121 | 121 |
122 for (m = 0; ngx_modules[m]; m++) { | 122 for (m = 0; cf->cycle->modules[m]; m++) { |
123 if (ngx_modules[m]->type != NGX_STREAM_MODULE) { | 123 if (cf->cycle->modules[m]->type != NGX_STREAM_MODULE) { |
124 continue; | 124 continue; |
125 } | 125 } |
126 | 126 |
127 module = ngx_modules[m]->ctx; | 127 module = cf->cycle->modules[m]->ctx; |
128 mi = ngx_modules[m]->ctx_index; | 128 mi = cf->cycle->modules[m]->ctx_index; |
129 | 129 |
130 if (module->create_main_conf) { | 130 if (module->create_main_conf) { |
131 ctx->main_conf[mi] = module->create_main_conf(cf); | 131 ctx->main_conf[mi] = module->create_main_conf(cf); |
132 if (ctx->main_conf[mi] == NULL) { | 132 if (ctx->main_conf[mi] == NULL) { |
133 return NGX_CONF_ERROR; | 133 return NGX_CONF_ERROR; |
161 /* init stream{} main_conf's, merge the server{}s' srv_conf's */ | 161 /* init stream{} main_conf's, merge the server{}s' srv_conf's */ |
162 | 162 |
163 cmcf = ctx->main_conf[ngx_stream_core_module.ctx_index]; | 163 cmcf = ctx->main_conf[ngx_stream_core_module.ctx_index]; |
164 cscfp = cmcf->servers.elts; | 164 cscfp = cmcf->servers.elts; |
165 | 165 |
166 for (m = 0; ngx_modules[m]; m++) { | 166 for (m = 0; cf->cycle->modules[m]; m++) { |
167 if (ngx_modules[m]->type != NGX_STREAM_MODULE) { | 167 if (cf->cycle->modules[m]->type != NGX_STREAM_MODULE) { |
168 continue; | 168 continue; |
169 } | 169 } |
170 | 170 |
171 module = ngx_modules[m]->ctx; | 171 module = cf->cycle->modules[m]->ctx; |
172 mi = ngx_modules[m]->ctx_index; | 172 mi = cf->cycle->modules[m]->ctx_index; |
173 | 173 |
174 /* init stream{} main_conf's */ | 174 /* init stream{} main_conf's */ |
175 | 175 |
176 cf->ctx = ctx; | 176 cf->ctx = ctx; |
177 | 177 |
199 } | 199 } |
200 } | 200 } |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 for (m = 0; ngx_modules[m]; m++) { | 204 for (m = 0; cf->cycle->modules[m]; m++) { |
205 if (ngx_modules[m]->type != NGX_STREAM_MODULE) { | 205 if (cf->cycle->modules[m]->type != NGX_STREAM_MODULE) { |
206 continue; | 206 continue; |
207 } | 207 } |
208 | 208 |
209 module = ngx_modules[m]->ctx; | 209 module = cf->cycle->modules[m]->ctx; |
210 | 210 |
211 if (module->postconfiguration) { | 211 if (module->postconfiguration) { |
212 if (module->postconfiguration(cf) != NGX_OK) { | 212 if (module->postconfiguration(cf) != NGX_OK) { |
213 return NGX_CONF_ERROR; | 213 return NGX_CONF_ERROR; |
214 } | 214 } |