diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2010-08-03 15:11:03 +0000 |
|---|---|---|
| committer | Jonathan Kolb <jon@b0g.us> | 2010-08-03 15:11:03 +0000 |
| commit | 26b470c6dd615adb79e7b7c4857684dc2be08090 (patch) | |
| tree | e3b97a87a2442d6101863aed2d621666275a8dae /src/http/ngx_http.c | |
| parent | 0b47af749c6a81e91d6d92f4793ed4455898a3fd (diff) | |
| download | nginx-26b470c6dd615adb79e7b7c4857684dc2be08090.tar.gz | |
Changes with nginx 0.8.48 03 Aug 2010v0.8.48
*) Change: now the "server_name" directive default value is an empty
name "".
Thanks to Gena Makhomed.
*) Change: now the "server_name_in_redirect" directive default value is
"off".
*) Feature: the $geoip_dma_code, $geoip_area_code, and
$geoip_region_name variables.
Thanks to Christine McGonagle.
*) Bugfix: the "proxy_pass", "fastcgi_pass", "uwsgi_pass", and
"scgi_pass" directives were not inherited inside "limit_except"
blocks.
*) Bugfix: the "proxy_cache_min_uses", "fastcgi_cache_min_uses"
"uwsgi_cache_min_uses", and "scgi_cache_min_uses" directives did not
work; the bug had appeared in 0.8.46.
*) Bugfix: the "fastcgi_split_path_info" directive used incorrectly
captures, if only parts of an URI were captured.
Thanks to Yuriy Taraday and Frank Enderle.
*) Bugfix: the "rewrite" directive did not escape a ";" character
during copying from URI to query string.
Thanks to Daisuke Murase.
*) Bugfix: the ngx_http_image_filter_module closed a connection, if an
image was larger than "image_filter_buffer" size.
Diffstat (limited to 'src/http/ngx_http.c')
| -rw-r--r-- | src/http/ngx_http.c | 108 |
1 files changed, 75 insertions, 33 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c index 9f9294ce5..f9aa44c1e 100644 --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -26,6 +26,9 @@ static ngx_int_t ngx_http_add_address(ngx_conf_t *cf, static ngx_int_t ngx_http_add_server(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf, ngx_http_conf_addr_t *addr); +static char *ngx_http_merge_servers(ngx_conf_t *cf, + ngx_http_core_main_conf_t *cmcf, ngx_http_module_t *module, + ngx_uint_t ctx_index); static char *ngx_http_merge_locations(ngx_conf_t *cf, ngx_queue_t *locations, void **loc_conf, ngx_http_module_t *module, ngx_uint_t ctx_index); @@ -263,39 +266,9 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } } - for (s = 0; s < cmcf->servers.nelts; s++) { - - /* merge the server{}s' srv_conf's */ - - if (module->merge_srv_conf) { - rv = module->merge_srv_conf(cf, ctx->srv_conf[mi], - cscfp[s]->ctx->srv_conf[mi]); - if (rv != NGX_CONF_OK) { - goto failed; - } - } - - if (module->merge_loc_conf) { - - /* merge the server{}'s loc_conf */ - - rv = module->merge_loc_conf(cf, ctx->loc_conf[mi], - cscfp[s]->ctx->loc_conf[mi]); - if (rv != NGX_CONF_OK) { - goto failed; - } - - /* merge the locations{}' loc_conf's */ - - clcf = cscfp[s]->ctx->loc_conf[ngx_http_core_module.ctx_index]; - - rv = ngx_http_merge_locations(cf, clcf->locations, - cscfp[s]->ctx->loc_conf, - module, mi); - if (rv != NGX_CONF_OK) { - goto failed; - } - } + rv = ngx_http_merge_servers(cf, cmcf, module, mi); + if (rv != NGX_CONF_OK) { + goto failed; } } @@ -586,11 +559,74 @@ ngx_http_init_phase_handlers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf) static char * +ngx_http_merge_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf, + ngx_http_module_t *module, ngx_uint_t ctx_index) +{ + char *rv; + ngx_uint_t s; + ngx_http_conf_ctx_t *ctx, saved; + ngx_http_core_loc_conf_t *clcf; + ngx_http_core_srv_conf_t **cscfp; + + cscfp = cmcf->servers.elts; + ctx = (ngx_http_conf_ctx_t *) cf->ctx; + saved = *ctx; + rv = NGX_CONF_OK; + + for (s = 0; s < cmcf->servers.nelts; s++) { + + /* merge the server{}s' srv_conf's */ + + ctx->srv_conf = cscfp[s]->ctx->srv_conf; + + if (module->merge_srv_conf) { + rv = module->merge_srv_conf(cf, saved.srv_conf[ctx_index], + cscfp[s]->ctx->srv_conf[ctx_index]); + if (rv != NGX_CONF_OK) { + goto failed; + } + } + + if (module->merge_loc_conf) { + + /* merge the server{}'s loc_conf */ + + ctx->loc_conf = cscfp[s]->ctx->loc_conf; + + rv = module->merge_loc_conf(cf, saved.loc_conf[ctx_index], + cscfp[s]->ctx->loc_conf[ctx_index]); + if (rv != NGX_CONF_OK) { + goto failed; + } + + /* merge the locations{}' loc_conf's */ + + clcf = cscfp[s]->ctx->loc_conf[ngx_http_core_module.ctx_index]; + + rv = ngx_http_merge_locations(cf, clcf->locations, + cscfp[s]->ctx->loc_conf, + module, ctx_index); + if (rv != NGX_CONF_OK) { + goto failed; + } + } + } + +failed: + + *ctx = saved; + + return rv; +} + + +static char * ngx_http_merge_locations(ngx_conf_t *cf, ngx_queue_t *locations, void **loc_conf, ngx_http_module_t *module, ngx_uint_t ctx_index) { char *rv; ngx_queue_t *q; + ngx_http_conf_ctx_t *ctx, saved; ngx_http_core_loc_conf_t *clcf; ngx_http_location_queue_t *lq; @@ -598,6 +634,9 @@ ngx_http_merge_locations(ngx_conf_t *cf, ngx_queue_t *locations, return NGX_CONF_OK; } + ctx = (ngx_http_conf_ctx_t *) cf->ctx; + saved = *ctx; + for (q = ngx_queue_head(locations); q != ngx_queue_sentinel(locations); q = ngx_queue_next(q)) @@ -605,6 +644,7 @@ ngx_http_merge_locations(ngx_conf_t *cf, ngx_queue_t *locations, lq = (ngx_http_location_queue_t *) q; clcf = lq->exact ? lq->exact : lq->inclusive; + ctx->loc_conf = clcf->loc_conf; rv = module->merge_loc_conf(cf, loc_conf[ctx_index], clcf->loc_conf[ctx_index]); @@ -619,6 +659,8 @@ ngx_http_merge_locations(ngx_conf_t *cf, ngx_queue_t *locations, } } + *ctx = saved; + return NGX_CONF_OK; } |
