Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 4856:43b7b9572fe1 stable-1.2
Merge of r4828: "include" with wildcards in map and types blocks.
The "include" directive should be able to include multiple files if
given a filename mask. Fixed this to work for "include" directives
inside the "map" or "types" blocks. The "include" directive inside
the "geo" block is still not fixed.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 24 Sep 2012 19:05:02 +0000 |
parents | 92a620dd8036 |
children | 880dedfa4008 |
comparison
equal
deleted
inserted
replaced
4855:f66d0a6d7fdd | 4856:43b7b9572fe1 |
---|---|
3191 static char * | 3191 static char * |
3192 ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) | 3192 ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) |
3193 { | 3193 { |
3194 ngx_http_core_loc_conf_t *clcf = conf; | 3194 ngx_http_core_loc_conf_t *clcf = conf; |
3195 | 3195 |
3196 ngx_str_t *value, *content_type, *old, file; | 3196 ngx_str_t *value, *content_type, *old; |
3197 ngx_uint_t i, n, hash; | 3197 ngx_uint_t i, n, hash; |
3198 ngx_hash_key_t *type; | 3198 ngx_hash_key_t *type; |
3199 | 3199 |
3200 value = cf->args->elts; | 3200 value = cf->args->elts; |
3201 | 3201 |
3204 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 3204 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
3205 "invalid number of arguments" | 3205 "invalid number of arguments" |
3206 " in \"include\" directive"); | 3206 " in \"include\" directive"); |
3207 return NGX_CONF_ERROR; | 3207 return NGX_CONF_ERROR; |
3208 } | 3208 } |
3209 file = value[1]; | 3209 |
3210 | 3210 return ngx_conf_include(cf, dummy, conf); |
3211 if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { | |
3212 return NGX_CONF_ERROR; | |
3213 } | |
3214 | |
3215 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); | |
3216 | |
3217 return ngx_conf_parse(cf, &file); | |
3218 } | 3211 } |
3219 | 3212 |
3220 content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t)); | 3213 content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t)); |
3221 if (content_type == NULL) { | 3214 if (content_type == NULL) { |
3222 return NGX_CONF_ERROR; | 3215 return NGX_CONF_ERROR; |