Mercurial > hg > nginx
comparison src/http/modules/ngx_http_map_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 | 735a05a53dc5 |
children | 8b635cf36ccc |
comparison
equal
deleted
inserted
replaced
4855:f66d0a6d7fdd | 4856:43b7b9572fe1 |
---|---|
367 | 367 |
368 static char * | 368 static char * |
369 ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) | 369 ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) |
370 { | 370 { |
371 ngx_int_t rc, index; | 371 ngx_int_t rc, index; |
372 ngx_str_t *value, file, name; | 372 ngx_str_t *value, name; |
373 ngx_uint_t i, key; | 373 ngx_uint_t i, key; |
374 ngx_http_map_conf_ctx_t *ctx; | 374 ngx_http_map_conf_ctx_t *ctx; |
375 ngx_http_variable_value_t *var, **vp; | 375 ngx_http_variable_value_t *var, **vp; |
376 | 376 |
377 ctx = cf->ctx; | 377 ctx = cf->ctx; |
389 "invalid number of the map parameters"); | 389 "invalid number of the map parameters"); |
390 return NGX_CONF_ERROR; | 390 return NGX_CONF_ERROR; |
391 } | 391 } |
392 | 392 |
393 if (ngx_strcmp(value[0].data, "include") == 0) { | 393 if (ngx_strcmp(value[0].data, "include") == 0) { |
394 file = value[1]; | 394 return ngx_conf_include(cf, dummy, conf); |
395 | |
396 if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { | |
397 return NGX_CONF_ERROR; | |
398 } | |
399 | |
400 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); | |
401 | |
402 return ngx_conf_parse(cf, &file); | |
403 } | 395 } |
404 | 396 |
405 if (value[1].data[0] == '$') { | 397 if (value[1].data[0] == '$') { |
406 name = value[1]; | 398 name = value[1]; |
407 name.len--; | 399 name.len--; |