comparison src/http/modules/ngx_http_chunked_filter_module.c @ 665:0b460e61bdcd default tip

Merge with nginx 1.0.0.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 25 Apr 2011 04:22:17 +0400
parents be4f34123024
children
comparison
equal deleted inserted replaced
572:06419a2298a9 665:0b460e61bdcd
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->headers_out.status == NGX_HTTP_CREATED
56 || r != r->main 57 || r != r->main
57 || (r->method & NGX_HTTP_HEAD)) 58 || (r->method & NGX_HTTP_HEAD))
58 { 59 {
59 return ngx_http_next_header_filter(r); 60 return ngx_http_next_header_filter(r);
60 } 61 }
62 if (r->headers_out.content_length_n == -1) { 63 if (r->headers_out.content_length_n == -1) {
63 if (r->http_version < NGX_HTTP_VERSION_11) { 64 if (r->http_version < NGX_HTTP_VERSION_11) {
64 r->keepalive = 0; 65 r->keepalive = 0;
65 66
66 } else { 67 } else {
67 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 }
68 } 76 }
69 } 77 }
70 78
71 return ngx_http_next_header_filter(r); 79 return ngx_http_next_header_filter(r);
72 } 80 }