comparison src/http/ngx_http.c @ 177:4db54fdbcbe7

nginx-0.0.1-2003-11-10-20:17:31 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 10 Nov 2003 17:17:31 +0000
parents c0552e5ab567
children c1f3a3c7c5db
comparison
equal deleted inserted replaced
176:c0552e5ab567 177:4db54fdbcbe7
105 } 105 }
106 106
107 module = ngx_modules[m]->ctx; 107 module = ngx_modules[m]->ctx;
108 mi = ngx_modules[m]->ctx_index; 108 mi = ngx_modules[m]->ctx_index;
109 109
110 if (module->pre_conf) {
111 if (module->pre_conf(cf) != NGX_OK) {
112 return NGX_CONF_ERROR;
113 }
114 }
115
110 if (module->create_main_conf) { 116 if (module->create_main_conf) {
111 ngx_test_null(ctx->main_conf[mi], module->create_main_conf(cf), 117 ngx_test_null(ctx->main_conf[mi], module->create_main_conf(cf),
112 NGX_CONF_ERROR); 118 NGX_CONF_ERROR);
113 } 119 }
114 120
155 /* init http{} main_conf's */ 161 /* init http{} main_conf's */
156 162
157 if (module->init_main_conf) { 163 if (module->init_main_conf) {
158 rv = module->init_main_conf(cf, ctx->main_conf[mi]); 164 rv = module->init_main_conf(cf, ctx->main_conf[mi]);
159 if (rv != NGX_CONF_OK) { 165 if (rv != NGX_CONF_OK) {
166 *cf = pcf;
160 return rv; 167 return rv;
161 } 168 }
162 } 169 }
163 170
164 for (s = 0; s < cmcf->servers.nelts; s++) { 171 for (s = 0; s < cmcf->servers.nelts; s++) {
168 if (module->merge_srv_conf) { 175 if (module->merge_srv_conf) {
169 rv = module->merge_srv_conf(cf, 176 rv = module->merge_srv_conf(cf,
170 ctx->srv_conf[mi], 177 ctx->srv_conf[mi],
171 cscfp[s]->ctx->srv_conf[mi]); 178 cscfp[s]->ctx->srv_conf[mi]);
172 if (rv != NGX_CONF_OK) { 179 if (rv != NGX_CONF_OK) {
180 *cf = pcf;
173 return rv; 181 return rv;
174 } 182 }
175 } 183 }
176 184
177 if (module->merge_loc_conf) { 185 if (module->merge_loc_conf) {
180 188
181 rv = module->merge_loc_conf(cf, 189 rv = module->merge_loc_conf(cf,
182 ctx->loc_conf[mi], 190 ctx->loc_conf[mi],
183 cscfp[s]->ctx->loc_conf[mi]); 191 cscfp[s]->ctx->loc_conf[mi]);
184 if (rv != NGX_CONF_OK) { 192 if (rv != NGX_CONF_OK) {
193 *cf = pcf;
185 return rv; 194 return rv;
186 } 195 }
187 196
188 /* merge the locations{}' loc_conf's */ 197 /* merge the locations{}' loc_conf's */
189 198
192 for (l = 0; l < cscfp[s]->locations.nelts; l++) { 201 for (l = 0; l < cscfp[s]->locations.nelts; l++) {
193 rv = module->merge_loc_conf(cf, 202 rv = module->merge_loc_conf(cf,
194 cscfp[s]->ctx->loc_conf[mi], 203 cscfp[s]->ctx->loc_conf[mi],
195 clcfp[l]->loc_conf[mi]); 204 clcfp[l]->loc_conf[mi]);
196 if (rv != NGX_CONF_OK) { 205 if (rv != NGX_CONF_OK) {
206 *cf = pcf;
197 return rv; 207 return rv;
198 } 208 }
199 } 209 }
200 } 210 }
201 } 211 }
202 } 212 }
203 213
214 /* we needed "http"'s cf->ctx while merging configuration */
215 *cf = pcf;
204 216
205 /* init lists of the handlers */ 217 /* init lists of the handlers */
206 218
207 ngx_init_array(cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers, 219 ngx_init_array(cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers,
208 cf->cycle->pool, 10, sizeof(ngx_http_handler_pt), 220 cf->cycle->pool, 10, sizeof(ngx_http_handler_pt),
555 } 567 }
556 } 568 }
557 } 569 }
558 /**/ 570 /**/
559 571
560 *cf = pcf;
561 return NGX_CONF_OK; 572 return NGX_CONF_OK;
562 } 573 }