Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4815 - trunk/src/http/modules

Anonymous User
August 16, 2012 07:00AM
Author: mdounin
Date: 2012-08-16 10:58:18 +0000 (Thu, 16 Aug 2012)
New Revision: 4815
URL: http://trac.nginx.org/nginx/changeset/4815/nginx

Log:
Map: fixed optimization of variables as values.

Previous code incorrectly used ctx->var_values as an array of pointers to
ngx_http_variable_value_t, but the array contains structures, not pointers.
Additionally, ctx->var_values inspection failed to properly set var on
match.


Modified:
trunk/src/http/modules/ngx_http_map_module.c

Modified: trunk/src/http/modules/ngx_http_map_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_map_module.c 2012-08-15 11:30:24 UTC (rev 4814)
+++ trunk/src/http/modules/ngx_http_map_module.c 2012-08-16 10:58:18 UTC (rev 4815)
@@ -416,11 +416,12 @@

for (i = 0; i < ctx->var_values.nelts; i++) {
if (index == (ngx_int_t) var[i].data) {
+ var = &var[i];
goto found;
}
}

- var = ngx_palloc(ctx->keys.pool, sizeof(ngx_http_variable_value_t));
+ var = ngx_array_push(&ctx->var_values);
if (var == NULL) {
return NGX_CONF_ERROR;
}
@@ -431,13 +432,6 @@
var->len = 0;
var->data = (u_char *) index;

- vp = ngx_array_push(&ctx->var_values);
- if (vp == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *vp = var;
-
goto found;
}


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

[nginx] svn commit: r4815 - trunk/src/http/modules

Anonymous User 1149 August 16, 2012 07:00AM



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

Online Users

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