comparison src/http/modules/ngx_http_headers_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 56688ed172c8
children c982febb7588
comparison
equal deleted inserted replaced
229:1965c8e23be7 230:38e7b94d63ac
26 #define NGX_HTTP_EXPIRES_UNSET -2147483647 26 #define NGX_HTTP_EXPIRES_UNSET -2147483647
27 #define NGX_HTTP_EXPIRES_OFF -2147483646 27 #define NGX_HTTP_EXPIRES_OFF -2147483646
28 #define NGX_HTTP_EXPIRES_EPOCH -2147483645 28 #define NGX_HTTP_EXPIRES_EPOCH -2147483645
29 29
30 30
31 static ngx_int_t ngx_http_headers_filter_init(ngx_cycle_t *cycle);
32 static void *ngx_http_headers_create_conf(ngx_conf_t *cf); 31 static void *ngx_http_headers_create_conf(ngx_conf_t *cf);
33 static char *ngx_http_headers_merge_conf(ngx_conf_t *cf, 32 static char *ngx_http_headers_merge_conf(ngx_conf_t *cf,
34 void *parent, void *child); 33 void *parent, void *child);
34 static ngx_int_t ngx_http_headers_filter_init(ngx_conf_t *cf);
35 static char *ngx_http_headers_expires(ngx_conf_t *cf, ngx_command_t *cmd, 35 static char *ngx_http_headers_expires(ngx_conf_t *cf, ngx_command_t *cmd,
36 void *conf); 36 void *conf);
37 static char *ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd, 37 static char *ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd,
38 void *conf); 38 void *conf);
39 39
60 }; 60 };
61 61
62 62
63 static ngx_http_module_t ngx_http_headers_filter_module_ctx = { 63 static ngx_http_module_t ngx_http_headers_filter_module_ctx = {
64 NULL, /* preconfiguration */ 64 NULL, /* preconfiguration */
65 NULL, /* postconfiguration */ 65 ngx_http_headers_filter_init, /* postconfiguration */
66 66
67 NULL, /* create main configuration */ 67 NULL, /* create main configuration */
68 NULL, /* init main configuration */ 68 NULL, /* init main configuration */
69 69
70 NULL, /* create server configuration */ 70 NULL, /* create server configuration */
79 NGX_MODULE_V1, 79 NGX_MODULE_V1,
80 &ngx_http_headers_filter_module_ctx, /* module context */ 80 &ngx_http_headers_filter_module_ctx, /* module context */
81 ngx_http_headers_filter_commands, /* module directives */ 81 ngx_http_headers_filter_commands, /* module directives */
82 NGX_HTTP_MODULE, /* module type */ 82 NGX_HTTP_MODULE, /* module type */
83 NULL, /* init master */ 83 NULL, /* init master */
84 ngx_http_headers_filter_init, /* init module */ 84 NULL, /* init module */
85 NULL, /* init process */ 85 NULL, /* init process */
86 NULL, /* init thread */ 86 NULL, /* init thread */
87 NULL, /* exit thread */ 87 NULL, /* exit thread */
88 NULL, /* exit process */ 88 NULL, /* exit process */
89 NULL, /* exit master */ 89 NULL, /* exit master */
272 272
273 return ngx_http_next_header_filter(r); 273 return ngx_http_next_header_filter(r);
274 } 274 }
275 275
276 276
277 static ngx_int_t
278 ngx_http_headers_filter_init(ngx_cycle_t *cycle)
279 {
280 ngx_http_next_header_filter = ngx_http_top_header_filter;
281 ngx_http_top_header_filter = ngx_http_headers_filter;
282
283 return NGX_OK;
284 }
285
286
287 static void * 277 static void *
288 ngx_http_headers_create_conf(ngx_conf_t *cf) 278 ngx_http_headers_create_conf(ngx_conf_t *cf)
289 { 279 {
290 ngx_http_headers_conf_t *conf; 280 ngx_http_headers_conf_t *conf;
291 281
329 319
330 return NGX_CONF_OK; 320 return NGX_CONF_OK;
331 } 321 }
332 322
333 323
324 static ngx_int_t
325 ngx_http_headers_filter_init(ngx_conf_t *cf)
326 {
327 ngx_http_next_header_filter = ngx_http_top_header_filter;
328 ngx_http_top_header_filter = ngx_http_headers_filter;
329
330 return NGX_OK;
331 }
332
333
334 static char * 334 static char *
335 ngx_http_headers_expires(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 335 ngx_http_headers_expires(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
336 { 336 {
337 ngx_http_headers_conf_t *hcf = conf; 337 ngx_http_headers_conf_t *hcf = conf;
338 338