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