comparison src/http/modules/ngx_http_range_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 3866d57d9cfd
children 29a6403156b0
comparison
equal deleted inserted replaced
229:1965c8e23be7 230:38e7b94d63ac
47 typedef struct { 47 typedef struct {
48 ngx_str_t boundary_header; 48 ngx_str_t boundary_header;
49 } ngx_http_range_filter_ctx_t; 49 } ngx_http_range_filter_ctx_t;
50 50
51 51
52 static ngx_int_t ngx_http_range_header_filter_init(ngx_cycle_t *cycle); 52 static ngx_int_t ngx_http_range_header_filter_init(ngx_conf_t *cf);
53 static ngx_int_t ngx_http_range_body_filter_init(ngx_cycle_t *cycle); 53 static ngx_int_t ngx_http_range_body_filter_init(ngx_conf_t *cf);
54 54
55 55
56 static ngx_http_module_t ngx_http_range_header_filter_module_ctx = { 56 static ngx_http_module_t ngx_http_range_header_filter_module_ctx = {
57 NULL, /* preconfiguration */ 57 NULL, /* preconfiguration */
58 NULL, /* postconfiguration */ 58 ngx_http_range_header_filter_init, /* postconfiguration */
59 59
60 NULL, /* create main configuration */ 60 NULL, /* create main configuration */
61 NULL, /* init main configuration */ 61 NULL, /* init main configuration */
62 62
63 NULL, /* create server configuration */ 63 NULL, /* create server configuration */
72 NGX_MODULE_V1, 72 NGX_MODULE_V1,
73 &ngx_http_range_header_filter_module_ctx, /* module context */ 73 &ngx_http_range_header_filter_module_ctx, /* module context */
74 NULL, /* module directives */ 74 NULL, /* module directives */
75 NGX_HTTP_MODULE, /* module type */ 75 NGX_HTTP_MODULE, /* module type */
76 NULL, /* init master */ 76 NULL, /* init master */
77 ngx_http_range_header_filter_init, /* init module */ 77 NULL, /* init module */
78 NULL, /* init process */ 78 NULL, /* init process */
79 NULL, /* init thread */ 79 NULL, /* init thread */
80 NULL, /* exit thread */ 80 NULL, /* exit thread */
81 NULL, /* exit process */ 81 NULL, /* exit process */
82 NULL, /* exit master */ 82 NULL, /* exit master */
84 }; 84 };
85 85
86 86
87 static ngx_http_module_t ngx_http_range_body_filter_module_ctx = { 87 static ngx_http_module_t ngx_http_range_body_filter_module_ctx = {
88 NULL, /* preconfiguration */ 88 NULL, /* preconfiguration */
89 NULL, /* postconfiguration */ 89 ngx_http_range_body_filter_init, /* postconfiguration */
90 90
91 NULL, /* create main configuration */ 91 NULL, /* create main configuration */
92 NULL, /* init main configuration */ 92 NULL, /* init main configuration */
93 93
94 NULL, /* create server configuration */ 94 NULL, /* create server configuration */
103 NGX_MODULE_V1, 103 NGX_MODULE_V1,
104 &ngx_http_range_body_filter_module_ctx, /* module context */ 104 &ngx_http_range_body_filter_module_ctx, /* module context */
105 NULL, /* module directives */ 105 NULL, /* module directives */
106 NGX_HTTP_MODULE, /* module type */ 106 NGX_HTTP_MODULE, /* module type */
107 NULL, /* init master */ 107 NULL, /* init master */
108 ngx_http_range_body_filter_init, /* init module */ 108 NULL, /* init module */
109 NULL, /* init process */ 109 NULL, /* init process */
110 NULL, /* init thread */ 110 NULL, /* init thread */
111 NULL, /* exit thread */ 111 NULL, /* exit thread */
112 NULL, /* exit process */ 112 NULL, /* exit process */
113 NULL, /* exit master */ 113 NULL, /* exit master */
586 return ngx_http_next_body_filter(r, in); 586 return ngx_http_next_body_filter(r, in);
587 } 587 }
588 588
589 589
590 static ngx_int_t 590 static ngx_int_t
591 ngx_http_range_header_filter_init(ngx_cycle_t *cycle) 591 ngx_http_range_header_filter_init(ngx_conf_t *cf)
592 { 592 {
593 ngx_http_next_header_filter = ngx_http_top_header_filter; 593 ngx_http_next_header_filter = ngx_http_top_header_filter;
594 ngx_http_top_header_filter = ngx_http_range_header_filter; 594 ngx_http_top_header_filter = ngx_http_range_header_filter;
595 595
596 return NGX_OK; 596 return NGX_OK;
597 } 597 }
598 598
599 599
600 static ngx_int_t 600 static ngx_int_t
601 ngx_http_range_body_filter_init(ngx_cycle_t *cycle) 601 ngx_http_range_body_filter_init(ngx_conf_t *cf)
602 { 602 {
603 ngx_http_next_body_filter = ngx_http_top_body_filter; 603 ngx_http_next_body_filter = ngx_http_top_body_filter;
604 ngx_http_top_body_filter = ngx_http_range_body_filter; 604 ngx_http_top_body_filter = ngx_http_range_body_filter;
605 605
606 return NGX_OK; 606 return NGX_OK;