Mercurial > hg > nginx
diff src/core/ngx_conf_file.c @ 5330:314c3d7cc3a5
Backed out f1a91825730a and 7094bd12c1ff.
While ngx_get_full_name() might have a bit more descriptive arguments,
the ngx_conf_full_name() is generally easier to use when parsing
configuration and limits exposure of cycle->prefix / cycle->conf_prefix
details.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 20 Aug 2013 21:11:19 +0400 |
parents | 7094bd12c1ff |
children | e04083b79335 |
line wrap: on
line diff
--- a/src/core/ngx_conf_file.c Wed Aug 21 19:19:47 2013 +0400 +++ b/src/core/ngx_conf_file.c Tue Aug 20 21:11:19 2013 +0400 @@ -747,7 +747,7 @@ ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); - if (ngx_get_full_name(cf->pool, &cf->cycle->conf_prefix, &file) != NGX_OK) { + if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { return NGX_CONF_ERROR; } @@ -797,6 +797,16 @@ } +ngx_int_t +ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name, ngx_uint_t conf_prefix) +{ + return ngx_get_full_name(cycle->pool, + conf_prefix ? &cycle->conf_prefix: + &cycle->prefix, + name); +} + + ngx_open_file_t * ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) { @@ -812,7 +822,7 @@ if (name->len) { full = *name; - if (ngx_get_full_name(cycle->pool, &cycle->prefix, &full) != NGX_OK) { + if (ngx_conf_full_name(cycle, &full, 0) != NGX_OK) { return NULL; }