Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4642 - trunk/src/http

Anonymous User
May 17, 2012 02:12PM
Author: mdounin
Date: 2012-05-17 18:10:34 +0000 (Thu, 17 May 2012)
New Revision: 4642
URL: http://trac.nginx.org/nginx/changeset/4642/nginx

Log:
Fixed core variables dynamic access after reconfiguration.

If variable was indexed in previous configuration but not in current
one, the NGX_HTTP_VAR_INDEXED flag was left set and confused
ngx_http_get_variable().

Patch by Yichun Zhang (agentzh), slightly modified.


Modified:
trunk/src/http/ngx_http_variables.c

Modified: trunk/src/http/ngx_http_variables.c
===================================================================
--- trunk/src/http/ngx_http_variables.c 2012-05-17 17:41:40 UTC (rev 4641)
+++ trunk/src/http/ngx_http_variables.c 2012-05-17 18:10:34 UTC (rev 4642)
@@ -2016,7 +2016,7 @@
ngx_http_variables_add_core_vars(ngx_conf_t *cf)
{
ngx_int_t rc;
- ngx_http_variable_t *v;
+ ngx_http_variable_t *cv, *v;
ngx_http_core_main_conf_t *cmcf;

cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
@@ -2036,7 +2036,14 @@
return NGX_ERROR;
}

- for (v = ngx_http_core_variables; v->name.len; v++) {
+ for (cv = ngx_http_core_variables; cv->name.len; cv++) {
+ v = ngx_palloc(cf->pool, sizeof(ngx_http_variable_t));
+ if (v == NULL) {
+ return NGX_ERROR;
+ }
+
+ *v = *cv;
+
rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v,
NGX_HASH_READONLY_KEY);


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

[nginx] svn commit: r4642 - trunk/src/http

Anonymous User 1896 May 17, 2012 02:12PM



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

Online Users

Guests: 263
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