Welcome! Log In Create A New Profile

Advanced

Re: Lua Variable access bug?

Maxim Dounin
May 17, 2012 09:08AM
Hello!

On Thu, May 17, 2012 at 07:42:45PM +0800, agentzh wrote:

> On Thu, May 17, 2012 at 5:02 PM, Maxim Dounin <mdounin@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 :)

No, disregard this patch. It will break things if new
configuration will be rejected for some reason, as global in
master will be left in an inconsistent state. As a result
incorrect worker processes will be spawn e.g. after abnormal
termination of a worker process (or after SIGWINCH + SIGHUP
sequence).

Allocating temporary copy of a variable looks like the only
correct way.

Maxim Dounin

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

Lua Variable access bug?

Sirsiwal, Umesh 1682 May 15, 2012 10:18PM

Re: Lua Variable access bug? Attachments

agentzh 509 May 17, 2012 04:36AM

Re: Lua Variable access bug?

Maxim Dounin 497 May 17, 2012 05:04AM

Re: Lua Variable access bug?

agentzh 477 May 17, 2012 07:44AM

Re: Lua Variable access bug?

Maxim Dounin 465 May 17, 2012 09:08AM

Re: Lua Variable access bug?

agentzh 529 May 17, 2012 09:16AM

Re: Lua Variable access bug?

Sirsiwal, Umesh 488 May 17, 2012 09:38AM

Re: Lua Variable access bug?

Maxim Dounin 526 May 17, 2012 02:12PM

Re: Lua Variable access bug?

lanshun zhou 481 May 17, 2012 11:00PM

Re: Lua Variable access bug?

Maxim Dounin 592 May 18, 2012 07:10AM

Re: Lua Variable access bug? Attachments

lanshun zhou 603 May 22, 2012 06:34AM



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

Online Users

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