comparison src/http/ngx_http_core_module.c @ 4827:6e46016ea276

Fixed the "include" directive. 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 Ruslan Ermilov <ru@nginx.com>
date Tue, 28 Aug 2012 13:31:01 +0000
parents b07931054bf1
children f57154322e0e
comparison
equal deleted inserted replaced
4826:c7d549856ab6 4827:6e46016ea276
3234 static char * 3234 static char *
3235 ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) 3235 ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
3236 { 3236 {
3237 ngx_http_core_loc_conf_t *clcf = conf; 3237 ngx_http_core_loc_conf_t *clcf = conf;
3238 3238
3239 ngx_str_t *value, *content_type, *old, file; 3239 ngx_str_t *value, *content_type, *old;
3240 ngx_uint_t i, n, hash; 3240 ngx_uint_t i, n, hash;
3241 ngx_hash_key_t *type; 3241 ngx_hash_key_t *type;
3242 3242
3243 value = cf->args->elts; 3243 value = cf->args->elts;
3244 3244
3247 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 3247 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3248 "invalid number of arguments" 3248 "invalid number of arguments"
3249 " in \"include\" directive"); 3249 " in \"include\" directive");
3250 return NGX_CONF_ERROR; 3250 return NGX_CONF_ERROR;
3251 } 3251 }
3252 file = value[1]; 3252
3253 3253 return ngx_conf_include(cf, dummy, conf);
3254 if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) {
3255 return NGX_CONF_ERROR;
3256 }
3257
3258 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
3259
3260 return ngx_conf_parse(cf, &file);
3261 } 3254 }
3262 3255
3263 content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t)); 3256 content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t));
3264 if (content_type == NULL) { 3257 if (content_type == NULL) {
3265 return NGX_CONF_ERROR; 3258 return NGX_CONF_ERROR;