Mercurial > hg > nginx
comparison src/http/modules/ngx_http_rewrite_module.c @ 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 | 562806624c4a |
children | 7b71936d5299 |
comparison
equal
deleted
inserted
replaced
680:63a949f7ed4f | 681:7e24168b0853 |
---|---|
21 | 21 |
22 | 22 |
23 static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf); | 23 static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf); |
24 static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf, | 24 static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf, |
25 void *parent, void *child); | 25 void *parent, void *child); |
26 static ngx_int_t ngx_http_rewrite_init(ngx_cycle_t *cycle); | 26 static ngx_int_t ngx_http_rewrite_init(ngx_conf_t *cf); |
27 static char *ngx_http_rewrite(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); | 27 static char *ngx_http_rewrite(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
28 static char *ngx_http_rewrite_return(ngx_conf_t *cf, ngx_command_t *cmd, | 28 static char *ngx_http_rewrite_return(ngx_conf_t *cf, ngx_command_t *cmd, |
29 void *conf); | 29 void *conf); |
30 static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, | 30 static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, |
31 void *conf); | 31 void *conf); |
102 }; | 102 }; |
103 | 103 |
104 | 104 |
105 static ngx_http_module_t ngx_http_rewrite_module_ctx = { | 105 static ngx_http_module_t ngx_http_rewrite_module_ctx = { |
106 NULL, /* preconfiguration */ | 106 NULL, /* preconfiguration */ |
107 NULL, /* postconfiguration */ | 107 ngx_http_rewrite_init, /* postconfiguration */ |
108 | 108 |
109 NULL, /* create main configuration */ | 109 NULL, /* create main configuration */ |
110 NULL, /* init main configuration */ | 110 NULL, /* init main configuration */ |
111 | 111 |
112 NULL, /* create server configuration */ | 112 NULL, /* create server configuration */ |
121 NGX_MODULE_V1, | 121 NGX_MODULE_V1, |
122 &ngx_http_rewrite_module_ctx, /* module context */ | 122 &ngx_http_rewrite_module_ctx, /* module context */ |
123 ngx_http_rewrite_commands, /* module directives */ | 123 ngx_http_rewrite_commands, /* module directives */ |
124 NGX_HTTP_MODULE, /* module type */ | 124 NGX_HTTP_MODULE, /* module type */ |
125 NULL, /* init master */ | 125 NULL, /* init master */ |
126 ngx_http_rewrite_init, /* init module */ | 126 NULL, /* init module */ |
127 NULL, /* init process */ | 127 NULL, /* init process */ |
128 NULL, /* init thread */ | 128 NULL, /* init thread */ |
129 NULL, /* exit thread */ | 129 NULL, /* exit thread */ |
130 NULL, /* exit process */ | 130 NULL, /* exit process */ |
131 NULL, /* exit master */ | 131 NULL, /* exit master */ |
265 return NGX_CONF_OK; | 265 return NGX_CONF_OK; |
266 } | 266 } |
267 | 267 |
268 | 268 |
269 static ngx_int_t | 269 static ngx_int_t |
270 ngx_http_rewrite_init(ngx_cycle_t *cycle) | 270 ngx_http_rewrite_init(ngx_conf_t *cf) |
271 { | 271 { |
272 ngx_http_handler_pt *h; | 272 ngx_http_handler_pt *h; |
273 ngx_http_core_main_conf_t *cmcf; | 273 ngx_http_core_main_conf_t *cmcf; |
274 | 274 |
275 cmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_core_module); | 275 cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); |
276 | 276 |
277 h = ngx_array_push(&cmcf->phases[NGX_HTTP_SERVER_REWRITE_PHASE].handlers); | 277 h = ngx_array_push(&cmcf->phases[NGX_HTTP_SERVER_REWRITE_PHASE].handlers); |
278 if (h == NULL) { | 278 if (h == NULL) { |
279 return NGX_ERROR; | 279 return NGX_ERROR; |
280 } | 280 } |