Mercurial > hg > nginx
comparison src/http/modules/ngx_http_chunked_filter_module.c @ 3484:81457372d938
chunked_transfer_encoding
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 01 Apr 2010 10:18:00 +0000 |
parents | 50ad44defdbb |
children | a28ba1cdec27 525a34d74a0a |
comparison
equal
deleted
inserted
replaced
3483:192b727c2563 | 3484:81457372d938 |
---|---|
48 | 48 |
49 | 49 |
50 static ngx_int_t | 50 static ngx_int_t |
51 ngx_http_chunked_header_filter(ngx_http_request_t *r) | 51 ngx_http_chunked_header_filter(ngx_http_request_t *r) |
52 { | 52 { |
53 ngx_http_core_loc_conf_t *clcf; | |
54 | |
53 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED | 55 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED |
54 || r->headers_out.status == NGX_HTTP_NO_CONTENT | 56 || r->headers_out.status == NGX_HTTP_NO_CONTENT |
55 || r != r->main | 57 || r != r->main |
56 || (r->method & NGX_HTTP_HEAD)) | 58 || (r->method & NGX_HTTP_HEAD)) |
57 { | 59 { |
61 if (r->headers_out.content_length_n == -1) { | 63 if (r->headers_out.content_length_n == -1) { |
62 if (r->http_version < NGX_HTTP_VERSION_11) { | 64 if (r->http_version < NGX_HTTP_VERSION_11) { |
63 r->keepalive = 0; | 65 r->keepalive = 0; |
64 | 66 |
65 } else { | 67 } else { |
66 r->chunked = 1; | 68 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
69 | |
70 if (clcf->chunked_transfer_encoding) { | |
71 r->chunked = 1; | |
72 | |
73 } else { | |
74 r->keepalive = 0; | |
75 } | |
67 } | 76 } |
68 } | 77 } |
69 | 78 |
70 return ngx_http_next_header_filter(r); | 79 return ngx_http_next_header_filter(r); |
71 } | 80 } |