Lua Variable access bug?

agentzh agentzh at gmail.com
Thu May 17 11:42:45 UTC 2012


On Thu, May 17, 2012 at 5:02 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> Shouldn't it be
>
> --- a/src/http/ngx_http_variables.c
> +++ b/src/http/ngx_http_variables.c
> @@ -2072,6 +2072,11 @@ ngx_http_variables_init_vars(ngx_conf_t
>     v = cmcf->variables.elts;
>     key = cmcf->variables_keys->keys.elts;
>
> +    for (n = 0; n < cmcf->variables_keys->keys.nelts; n++) {
> +        av = key[n].value;
> +        av->flags &= ~NGX_HTTP_VAR_INDEXED;
> +    }
> +
>     for (i = 0; i < cmcf->variables.nelts; i++) {
>
>         for (n = 0; n < cmcf->variables_keys->keys.nelts; n++) {
>
>
> instead?
>

Yes, this patch is better and is more efficient :)

> (completely untested)
>

I've tested it on my side and it indeed solves this problem.

Thanks!
-agentzh



More information about the nginx-devel mailing list