Mercurial > hg > nginx-vendor-current
comparison src/http/ngx_http_header_filter_module.c @ 230:38e7b94d63ac NGINX_0_4_0
nginx 0.4.0
*) 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; bug appeared in 0.1.29.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 30 Aug 2006 00:00:00 +0400 |
parents | 1bf60f8c5c9e |
children | c5c2b2883984 |
comparison
equal
deleted
inserted
replaced
229:1965c8e23be7 | 230:38e7b94d63ac |
---|---|
8 #include <ngx_core.h> | 8 #include <ngx_core.h> |
9 #include <ngx_http.h> | 9 #include <ngx_http.h> |
10 #include <nginx.h> | 10 #include <nginx.h> |
11 | 11 |
12 | 12 |
13 static ngx_int_t ngx_http_header_filter_init(ngx_cycle_t *cycle); | 13 static ngx_int_t ngx_http_header_filter_init(ngx_conf_t *cf); |
14 static ngx_int_t ngx_http_header_filter(ngx_http_request_t *r); | 14 static ngx_int_t ngx_http_header_filter(ngx_http_request_t *r); |
15 | 15 |
16 | 16 |
17 static ngx_http_module_t ngx_http_header_filter_module_ctx = { | 17 static ngx_http_module_t ngx_http_header_filter_module_ctx = { |
18 NULL, /* preconfiguration */ | 18 NULL, /* preconfiguration */ |
19 NULL, /* postconfiguration */ | 19 ngx_http_header_filter_init, /* postconfiguration */ |
20 | 20 |
21 NULL, /* create main configuration */ | 21 NULL, /* create main configuration */ |
22 NULL, /* init main configuration */ | 22 NULL, /* init main configuration */ |
23 | 23 |
24 NULL, /* create server configuration */ | 24 NULL, /* create server configuration */ |
33 NGX_MODULE_V1, | 33 NGX_MODULE_V1, |
34 &ngx_http_header_filter_module_ctx, /* module context */ | 34 &ngx_http_header_filter_module_ctx, /* module context */ |
35 NULL, /* module directives */ | 35 NULL, /* module directives */ |
36 NGX_HTTP_MODULE, /* module type */ | 36 NGX_HTTP_MODULE, /* module type */ |
37 NULL, /* init master */ | 37 NULL, /* init master */ |
38 ngx_http_header_filter_init, /* init module */ | 38 NULL, /* init module */ |
39 NULL, /* init process */ | 39 NULL, /* init process */ |
40 NULL, /* init thread */ | 40 NULL, /* init thread */ |
41 NULL, /* exit thread */ | 41 NULL, /* exit thread */ |
42 NULL, /* exit process */ | 42 NULL, /* exit process */ |
43 NULL, /* exit master */ | 43 NULL, /* exit master */ |
150 static ngx_int_t | 150 static ngx_int_t |
151 ngx_http_header_filter(ngx_http_request_t *r) | 151 ngx_http_header_filter(ngx_http_request_t *r) |
152 { | 152 { |
153 u_char *p; | 153 u_char *p; |
154 size_t len; | 154 size_t len; |
155 ngx_buf_t *b; | |
155 ngx_uint_t status, i; | 156 ngx_uint_t status, i; |
156 ngx_buf_t *b; | |
157 ngx_chain_t out; | 157 ngx_chain_t out; |
158 ngx_list_part_t *part; | 158 ngx_list_part_t *part; |
159 ngx_table_elt_t *header; | 159 ngx_table_elt_t *header; |
160 ngx_http_core_loc_conf_t *clcf; | 160 ngx_http_core_loc_conf_t *clcf; |
161 | 161 |
531 return ngx_http_write_filter(r, &out); | 531 return ngx_http_write_filter(r, &out); |
532 } | 532 } |
533 | 533 |
534 | 534 |
535 static ngx_int_t | 535 static ngx_int_t |
536 ngx_http_header_filter_init(ngx_cycle_t *cycle) | 536 ngx_http_header_filter_init(ngx_conf_t *cf) |
537 { | 537 { |
538 ngx_http_top_header_filter = ngx_http_header_filter; | 538 ngx_http_top_header_filter = ngx_http_header_filter; |
539 | 539 |
540 return NGX_OK; | 540 return NGX_OK; |
541 } | 541 } |