comparison src/stream/ngx_stream_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 68c106e6fa0a
children 78fc2dce69e7
comparison
equal deleted inserted replaced
6378:0f203a2af17c 6379:cf5e822cf470
114 114
115 ctx->srv_conf[ngx_stream_upstream_module.ctx_index] = uscf; 115 ctx->srv_conf[ngx_stream_upstream_module.ctx_index] = uscf;
116 116
117 uscf->srv_conf = ctx->srv_conf; 117 uscf->srv_conf = ctx->srv_conf;
118 118
119 for (m = 0; ngx_modules[m]; m++) { 119 for (m = 0; cf->cycle->modules[m]; m++) {
120 if (ngx_modules[m]->type != NGX_STREAM_MODULE) { 120 if (cf->cycle->modules[m]->type != NGX_STREAM_MODULE) {
121 continue; 121 continue;
122 } 122 }
123 123
124 module = ngx_modules[m]->ctx; 124 module = cf->cycle->modules[m]->ctx;
125 125
126 if (module->create_srv_conf) { 126 if (module->create_srv_conf) {
127 mconf = module->create_srv_conf(cf); 127 mconf = module->create_srv_conf(cf);
128 if (mconf == NULL) { 128 if (mconf == NULL) {
129 return NGX_CONF_ERROR; 129 return NGX_CONF_ERROR;
130 } 130 }
131 131
132 ctx->srv_conf[ngx_modules[m]->ctx_index] = mconf; 132 ctx->srv_conf[cf->cycle->modules[m]->ctx_index] = mconf;
133 } 133 }
134 } 134 }
135 135
136 uscf->servers = ngx_array_create(cf->pool, 4, 136 uscf->servers = ngx_array_create(cf->pool, 4,
137 sizeof(ngx_stream_upstream_server_t)); 137 sizeof(ngx_stream_upstream_server_t));