comparison src/http/modules/ngx_http_not_modified_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 36af50a5582d
children 05693816539c
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 10
11 11
12 12
13 static ngx_int_t ngx_http_not_modified_filter_init(ngx_cycle_t *cycle); 13 static ngx_int_t ngx_http_not_modified_filter_init(ngx_conf_t *cf);
14 14
15 15
16 static ngx_http_module_t ngx_http_not_modified_filter_module_ctx = { 16 static ngx_http_module_t ngx_http_not_modified_filter_module_ctx = {
17 NULL, /* preconfiguration */ 17 NULL, /* preconfiguration */
18 NULL, /* postconfiguration */ 18 ngx_http_not_modified_filter_init, /* postconfiguration */
19 19
20 NULL, /* create main configuration */ 20 NULL, /* create main configuration */
21 NULL, /* init main configuration */ 21 NULL, /* init main configuration */
22 22
23 NULL, /* create server configuration */ 23 NULL, /* create server configuration */
32 NGX_MODULE_V1, 32 NGX_MODULE_V1,
33 &ngx_http_not_modified_filter_module_ctx, /* module context */ 33 &ngx_http_not_modified_filter_module_ctx, /* module context */
34 NULL, /* module directives */ 34 NULL, /* module directives */
35 NGX_HTTP_MODULE, /* module type */ 35 NGX_HTTP_MODULE, /* module type */
36 NULL, /* init master */ 36 NULL, /* init master */
37 ngx_http_not_modified_filter_init, /* init module */ 37 NULL, /* init module */
38 NULL, /* init process */ 38 NULL, /* init process */
39 NULL, /* init thread */ 39 NULL, /* init thread */
40 NULL, /* exit thread */ 40 NULL, /* exit thread */
41 NULL, /* exit process */ 41 NULL, /* exit process */
42 NULL, /* exit master */ 42 NULL, /* exit master */
45 45
46 46
47 static ngx_http_output_header_filter_pt ngx_http_next_header_filter; 47 static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
48 48
49 49
50 static ngx_int_t ngx_http_not_modified_header_filter(ngx_http_request_t *r) 50 static
51 ngx_int_t ngx_http_not_modified_header_filter(ngx_http_request_t *r)
51 { 52 {
52 time_t ims; 53 time_t ims;
53 54
54 if (r->headers_out.status != NGX_HTTP_OK 55 if (r->headers_out.status != NGX_HTTP_OK
55 || r != r->main 56 || r != r->main
78 79
79 return ngx_http_next_header_filter(r); 80 return ngx_http_next_header_filter(r);
80 } 81 }
81 82
82 83
83 static ngx_int_t ngx_http_not_modified_filter_init(ngx_cycle_t *cycle) 84 static
85 ngx_int_t ngx_http_not_modified_filter_init(ngx_conf_t *cf)
84 { 86 {
85 ngx_http_next_header_filter = ngx_http_top_header_filter; 87 ngx_http_next_header_filter = ngx_http_top_header_filter;
86 ngx_http_top_header_filter = ngx_http_not_modified_header_filter; 88 ngx_http_top_header_filter = ngx_http_not_modified_header_filter;
87 89
88 return NGX_OK; 90 return NGX_OK;