Mercurial > hg > nginx
diff src/http/ngx_http_core_module.h @ 681:7e24168b0853 release-0.4.0
nginx-0.4.0-RELEASE import
*) Change in internal API: the HTTP modules initialization was moved
from the init module phase to the HTTP postconfiguration phase.
*) Change: now the request body is not read beforehand for the
ngx_http_perl_module: it's required to start the reading using the
$r->has_request_body method.
*) Feature: the ngx_http_perl_module supports the DECLINED return code.
*) Feature: the ngx_http_dav_module supports the incoming "Date" header
line for the PUT method.
*) Feature: the "ssi" directive is available inside the "if" block.
*) Bugfix: a segmentation fault occurred if there was an "index"
directive with variables and the first index name was without
variables; the bug had appeared in 0.1.29.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 30 Aug 2006 10:39:17 +0000 |
parents | df95dcff753a |
children | 86bb73dc8d40 |
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.h Mon Aug 28 16:57:48 2006 +0000 +++ b/src/http/ngx_http_core_module.h Wed Aug 30 10:39:17 2006 +0000 @@ -49,28 +49,48 @@ NGX_HTTP_POST_READ_PHASE = 0, NGX_HTTP_SERVER_REWRITE_PHASE, + NGX_HTTP_FIND_CONFIG_PHASE, NGX_HTTP_REWRITE_PHASE, + NGX_HTTP_POST_REWRITE_PHASE, NGX_HTTP_PREACCESS_PHASE, NGX_HTTP_ACCESS_PHASE, + NGX_HTTP_POST_ACCESS_PHASE, + NGX_HTTP_CONTENT_PHASE, NGX_HTTP_LOG_PHASE } ngx_http_phases; +typedef struct ngx_http_phase_handler_s ngx_http_phase_handler_t; + +typedef ngx_int_t (*ngx_http_phase_handler_pt)(ngx_http_request_t *r, + ngx_http_phase_handler_t *ph); + +struct ngx_http_phase_handler_s { + ngx_http_phase_handler_pt checker; + ngx_http_handler_pt handler; + ngx_uint_t next; +}; + + +typedef struct { + ngx_http_phase_handler_t *handlers; + ngx_uint_t server_rewrite_index; +} ngx_http_phase_engine_t; + typedef struct { ngx_array_t handlers; - ngx_int_t type; /* NGX_OK, NGX_DECLINED */ } ngx_http_phase_t; typedef struct { ngx_array_t servers; /* ngx_http_core_srv_conf_t */ - ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; + ngx_http_phase_engine_t phase_engine; ngx_hash_t headers_in_hash; @@ -85,6 +105,8 @@ ngx_uint_t variables_hash_bucket_size; ngx_hash_keys_arrays_t *variables_keys; + + ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; } ngx_http_core_main_conf_t; @@ -262,7 +284,19 @@ }; -ngx_int_t ngx_http_find_location_config(ngx_http_request_t *r); +void ngx_http_core_run_phases(ngx_http_request_t *r); +ngx_int_t ngx_http_core_generic_phase(ngx_http_request_t *r, + ngx_http_phase_handler_t *ph); +ngx_int_t ngx_http_core_find_config_phase(ngx_http_request_t *r, + ngx_http_phase_handler_t *ph); +ngx_int_t ngx_http_core_post_rewrite_phase(ngx_http_request_t *r, + ngx_http_phase_handler_t *ph); +ngx_int_t ngx_http_core_access_phase(ngx_http_request_t *r, + ngx_http_phase_handler_t *ph); +ngx_int_t ngx_http_core_post_access_phase(ngx_http_request_t *r, + ngx_http_phase_handler_t *ph); +ngx_int_t ngx_http_core_content_phase(ngx_http_request_t *r, + ngx_http_phase_handler_t *ph); ngx_int_t ngx_http_set_content_type(ngx_http_request_t *r); ngx_int_t ngx_http_set_exten(ngx_http_request_t *r);