Mercurial > hg > nginx-vendor-0-5
diff src/core/ngx_conf_file.c @ 238:a528ae0fe909 NGINX_0_4_4
nginx 0.4.4
*) Feature: the $scheme variable.
*) Feature: the "expires" directive supports the "max" parameter.
*) Feature: the "include" directive supports the "*" mask.
Thanks to Jonathan Dance.
*) Bugfix: the "return" directive always overrode the "error_page"
response code redirected by the "error_page" directive.
*) Bugfix: a segmentation fault occurred if zero-length body was in PUT
method.
*) Bugfix: the redirect was changed incorrectly if the variables were
used in the "proxy_redirect" directive.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 02 Oct 2006 00:00:00 +0400 |
parents | 56688ed172c8 |
children | 29a6403156b0 |
line wrap: on
line diff
--- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -650,18 +650,52 @@ ngx_conf_read_token(ngx_conf_t *cf) static char * ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { - ngx_str_t *value, file; + char *rv; + ngx_int_t n; + ngx_str_t *value, file; + ngx_glob_t gl; value = cf->args->elts; file = value[1]; + ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); + if (ngx_conf_full_name(cf->cycle, &file) == NGX_ERROR) { return NGX_CONF_ERROR; } - ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); + ngx_memzero(&gl, sizeof(ngx_glob_t)); + + gl.pattern = file.data; + gl.log = cf->log; + + if (ngx_open_glob(&gl) != NGX_OK) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno, + ngx_open_glob_n " \"%s\" failed", file.data); + return NGX_CONF_ERROR; + } + + rv = NGX_CONF_OK; + + for ( ;; ) { + n = ngx_read_glob(&gl, &file); - return ngx_conf_parse(cf, &file); + if (n != NGX_OK) { + break; + } + + ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); + + rv = ngx_conf_parse(cf, &file); + + if (rv != NGX_CONF_OK) { + break; + } + } + + ngx_close_glob(&gl); + + return rv; }