diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2013-08-20 21:11:19 +0400 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-08-20 21:11:19 +0400 |
commit | e3cab7675801d224d1d5cdbe7f7b76bbaed97c91 (patch) | |
tree | 4d26e1efc552059730fa76391c9e9834d8e38cbe /src/core/ngx_conf_file.c | |
parent | 4c53a38fb59496e8280991b307a5fdfbd7f71040 (diff) |
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.
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r-- | src/core/ngx_conf_file.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index afa27d76c..6cfb5d58d 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -747,7 +747,7 @@ ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } +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 @@ ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) 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; } |