diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2004-07-18 19:11:20 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2004-07-18 19:11:20 +0000 |
| commit | 74a5ddb47aef86bb07336713bb1ace0007c2d452 (patch) | |
| tree | 449c6ceb229b7646ef40417135c66843a677746b /src/http/ngx_http.c | |
| parent | f38e046a0a2e7437f8232ef2a99cead69c4b9ebb (diff) | |
| download | nginx-74a5ddb47aef86bb07336713bb1ace0007c2d452.tar.gz nginx-74a5ddb47aef86bb07336713bb1ace0007c2d452.tar.bz2 | |
nginx-0.0.7-2004-07-18-23:11:20 import
Diffstat (limited to 'src/http/ngx_http.c')
| -rw-r--r-- | src/http/ngx_http.c | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c index 6fca25400..4b61d56f9 100644 --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -6,7 +6,11 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - +static char *ngx_http_merge_locations(ngx_conf_t *cf, + ngx_array_t *locations, + void **loc_conf, + ngx_http_module_t *module, + ngx_uint_t ctx_index); int ngx_http_max_module; @@ -204,7 +208,16 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) /* merge the locations{}' loc_conf's */ - clcfp = (ngx_http_core_loc_conf_t **)cscfp[s]->locations.elts; + rv = ngx_http_merge_locations(cf, &cscfp[s]->locations, + cscfp[s]->ctx->loc_conf, + module, mi); + if (rv != NGX_CONF_OK) { + *cf = pcf; + return rv; + } + +#if 0 + clcfp = (ngx_http_core_loc_conf_t **) cscfp[s]->locations.elts; for (l = 0; l < cscfp[s]->locations.nelts; l++) { rv = module->merge_loc_conf(cf, @@ -215,6 +228,7 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) return rv; } } +#endif } } } @@ -623,3 +637,33 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) return NGX_CONF_OK; } + + +static char *ngx_http_merge_locations(ngx_conf_t *cf, + ngx_array_t *locations, + void **loc_conf, + ngx_http_module_t *module, + ngx_uint_t ctx_index) +{ + char *rv; + ngx_uint_t i; + ngx_http_core_loc_conf_t **clcfp; + + clcfp = /* (ngx_http_core_loc_conf_t **) */ locations->elts; + + for (i = 0; i < locations->nelts; i++) { + rv = module->merge_loc_conf(cf, loc_conf[ctx_index], + clcfp[i]->loc_conf[ctx_index]); + if (rv != NGX_CONF_OK) { + return rv; + } + + rv = ngx_http_merge_locations(cf, &clcfp[i]->locations, + clcfp[i]->loc_conf, module, ctx_index); + if (rv != NGX_CONF_OK) { + return rv; + } + } + + return NGX_CONF_OK; +} |
