Mercurial > hg > nginx-ranges
comparison src/http/modules/ngx_http_chunked_filter_module.c @ 635:e67b227c8dbb default tip
Merge with current.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Apr 2011 04:07:55 +0400 |
parents | be4f34123024 |
children |
comparison
equal
deleted
inserted
replaced
578:f3a9e57d2e17 | 635:e67b227c8dbb |
---|---|
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 } |