Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4857 - in branches/stable-1.2: . src/core src/http src/http/modules

Anonymous User
September 24, 2012 03:06PM
Author: mdounin
Date: 2012-09-24 19:05:02 +0000 (Mon, 24 Sep 2012)
New Revision: 4857
URL: http://trac.nginx.org/nginx/changeset/4857/nginx

Log:
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.


Modified:
branches/stable-1.2/
branches/stable-1.2/src/core/ngx_conf_file.c
branches/stable-1.2/src/core/ngx_conf_file.h
branches/stable-1.2/src/http/modules/ngx_http_map_module.c
branches/stable-1.2/src/http/ngx_http_core_module.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2 2012-09-24 19:02:16 UTC (rev 4856)
+++ branches/stable-1.2 2012-09-24 19:05:02 UTC (rev 4857)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4830-4832,4834,4840,4842-4844
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828,4830-4832,4834,4840,4842-4844
\ No newline at end of property
Modified: branches/stable-1.2/src/core/ngx_conf_file.c
===================================================================
--- branches/stable-1.2/src/core/ngx_conf_file.c 2012-09-24 19:02:16 UTC (rev 4856)
+++ branches/stable-1.2/src/core/ngx_conf_file.c 2012-09-24 19:05:02 UTC (rev 4857)
@@ -12,7 +12,6 @@

static ngx_int_t ngx_conf_handler(ngx_conf_t *cf, ngx_int_t last);
static ngx_int_t ngx_conf_read_token(ngx_conf_t *cf);
-static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static ngx_int_t ngx_conf_test_full_name(ngx_str_t *name);
static void ngx_conf_flush_files(ngx_cycle_t *cycle);

@@ -731,7 +730,7 @@
}


-static char *
+char *
ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
char *rv;

Modified: branches/stable-1.2/src/core/ngx_conf_file.h
===================================================================
--- branches/stable-1.2/src/core/ngx_conf_file.h 2012-09-24 19:02:16 UTC (rev 4856)
+++ branches/stable-1.2/src/core/ngx_conf_file.h 2012-09-24 19:05:02 UTC (rev 4857)
@@ -317,6 +317,7 @@

char *ngx_conf_param(ngx_conf_t *cf);
char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename);
+char *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,

Modified: branches/stable-1.2/src/http/modules/ngx_http_map_module.c
===================================================================
--- branches/stable-1.2/src/http/modules/ngx_http_map_module.c 2012-09-24 19:02:16 UTC (rev 4856)
+++ branches/stable-1.2/src/http/modules/ngx_http_map_module.c 2012-09-24 19:05:02 UTC (rev 4857)
@@ -369,7 +369,7 @@
ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
{
ngx_int_t rc, index;
- ngx_str_t *value, file, name;
+ ngx_str_t *value, name;
ngx_uint_t i, key;
ngx_http_map_conf_ctx_t *ctx;
ngx_http_variable_value_t *var, **vp;
@@ -391,15 +391,7 @@
}

if (ngx_strcmp(value[0].data, "include") == 0) {
- file = value[1];
-
- if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
-
- return ngx_conf_parse(cf, &file);
+ return ngx_conf_include(cf, dummy, conf);
}

if (value[1].data[0] == '$') {

Modified: branches/stable-1.2/src/http/ngx_http_core_module.c
===================================================================
--- branches/stable-1.2/src/http/ngx_http_core_module.c 2012-09-24 19:02:16 UTC (rev 4856)
+++ branches/stable-1.2/src/http/ngx_http_core_module.c 2012-09-24 19:05:02 UTC (rev 4857)
@@ -3193,7 +3193,7 @@
{
ngx_http_core_loc_conf_t *clcf = conf;

- ngx_str_t *value, *content_type, *old, file;
+ ngx_str_t *value, *content_type, *old;
ngx_uint_t i, n, hash;
ngx_hash_key_t *type;

@@ -3206,15 +3206,8 @@
" in \"include\" directive");
return NGX_CONF_ERROR;
}
- file = value[1];

- if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
-
- return ngx_conf_parse(cf, &file);
+ return ngx_conf_include(cf, dummy, conf);
}

content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t));

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4857 - in branches/stable-1.2: . src/core src/http src/http/modules

Anonymous User 760 September 24, 2012 03:06PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 157
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready