comparison src/http/modules/ngx_http_chunked_filter.c @ 356:2e3cbc1bbe3c

nginx-0.0.7-2004-06-16-19:32:11 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 16 Jun 2004 15:32:11 +0000
parents 6bdf858bff8c
children da8c5707af39
comparison
equal deleted inserted replaced
355:0fb6c53fb135 356:2e3cbc1bbe3c
2 #include <ngx_config.h> 2 #include <ngx_config.h>
3 #include <ngx_core.h> 3 #include <ngx_core.h>
4 #include <ngx_http.h> 4 #include <ngx_http.h>
5 5
6 6
7 static int ngx_http_chunked_filter_init(ngx_cycle_t *cycle); 7 static ngx_int_t ngx_http_chunked_filter_init(ngx_cycle_t *cycle);
8 8
9 9
10 static ngx_http_module_t ngx_http_chunked_filter_module_ctx = { 10 static ngx_http_module_t ngx_http_chunked_filter_module_ctx = {
11 NULL, /* pre conf */ 11 NULL, /* pre conf */
12 12
33 33
34 static ngx_http_output_header_filter_pt ngx_http_next_header_filter; 34 static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
35 static ngx_http_output_body_filter_pt ngx_http_next_body_filter; 35 static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
36 36
37 37
38 static int ngx_http_chunked_header_filter(ngx_http_request_t *r) 38 static ngx_int_t ngx_http_chunked_header_filter(ngx_http_request_t *r)
39 { 39 {
40 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED) { 40 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED) {
41 return ngx_http_next_header_filter(r); 41 return ngx_http_next_header_filter(r);
42 } 42 }
43 43
52 52
53 return ngx_http_next_header_filter(r); 53 return ngx_http_next_header_filter(r);
54 } 54 }
55 55
56 56
57 static int ngx_http_chunked_body_filter(ngx_http_request_t *r, ngx_chain_t *in) 57 static ngx_int_t ngx_http_chunked_body_filter(ngx_http_request_t *r,
58 ngx_chain_t *in)
58 { 59 {
59 u_char *chunk; 60 u_char *chunk;
60 size_t size, len; 61 size_t size, len;
61 ngx_buf_t *b; 62 ngx_buf_t *b;
62 ngx_chain_t out, tail, *cl, *tl, **ll; 63 ngx_chain_t out, tail, *cl, *tl, **ll;
136 137
137 return ngx_http_next_body_filter(r, &out); 138 return ngx_http_next_body_filter(r, &out);
138 } 139 }
139 140
140 141
141 static int ngx_http_chunked_filter_init(ngx_cycle_t *cycle) 142 static ngx_int_t ngx_http_chunked_filter_init(ngx_cycle_t *cycle)
142 { 143 {
143 ngx_http_next_header_filter = ngx_http_top_header_filter; 144 ngx_http_next_header_filter = ngx_http_top_header_filter;
144 ngx_http_top_header_filter = ngx_http_chunked_header_filter; 145 ngx_http_top_header_filter = ngx_http_chunked_header_filter;
145 146
146 ngx_http_next_body_filter = ngx_http_top_body_filter; 147 ngx_http_next_body_filter = ngx_http_top_body_filter;