Welcome! Log In Create A New Profile

Advanced

About the phase handlers init

Jinhua Luo
September 03, 2021 12:10AM
Hi, All.

In the function ngx_http_init_phase_handlers, I found two places hard
to understand.

a) The n variable is as known as the next phase handler index. In the
switch case NGX_HTTP_ACCESS_PHASE, it invokes n++, which seems to be
redundant and wrong, While in switch case NGX_HTTP_POST_ACCESS_PHASE,
it lacks n++. Think about that if the number of modules registers as
NGX_HTTP_ACCESS_PHASE is 0, then the next index is 1 more than the
correct number. Of course, the current codes have at least one
NGX_HTTP_POST_ACCESS_PHASE module: ngx_http_access_module, but it
contains the codes to jump to the next phase handler, then the jump
target is bypass NGX_HTTP_POST_ACCESS_PHASE and to
NGX_HTTP_PRECONTENT_PHASE?

b) Does the handler runs in reverse order of registration order?

for (j = cmcf->phases[i].handlers.nelts - 1; j >= 0; j--)

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

About the phase handlers init

Jinhua Luo 378 September 03, 2021 12:10AM

Re: About the phase handlers init

Maxim Dounin 163 September 03, 2021 03:36PM

Re: About the phase handlers init

Jinhua Luo 103 September 04, 2021 11:50AM

Re: About the phase handlers init

Jinhua Luo 113 September 04, 2021 11:52AM

Re: About the phase handlers init

Maxim Dounin 123 September 04, 2021 02:30PM



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

Online Users

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