diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2010-06-07 09:19:10 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2010-06-07 09:19:10 +0000 |
| commit | da6332fa98b2821453ed010697dcbd254db3991b (patch) | |
| tree | f103bb96ced131a5dd121e839f0aa449ead6ae97 /src/http/modules | |
| parent | f4ed65dfaab1888cfdb8e355222d1bffdd5b0147 (diff) | |
| download | nginx-da6332fa98b2821453ed010697dcbd254db3991b.tar.gz nginx-da6332fa98b2821453ed010697dcbd254db3991b.tar.bz2 | |
merge r3412, r3485:
*) allow a chunked body for 201 responses
*) chunked_transfer_encoding
Diffstat (limited to 'src/http/modules')
| -rw-r--r-- | src/http/modules/ngx_http_chunked_filter_module.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_chunked_filter_module.c b/src/http/modules/ngx_http_chunked_filter_module.c index 846053ff4..9c4c5de14 100644 --- a/src/http/modules/ngx_http_chunked_filter_module.c +++ b/src/http/modules/ngx_http_chunked_filter_module.c @@ -50,9 +50,10 @@ static ngx_http_output_body_filter_pt ngx_http_next_body_filter; static ngx_int_t ngx_http_chunked_header_filter(ngx_http_request_t *r) { + ngx_http_core_loc_conf_t *clcf; + if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED || r->headers_out.status == NGX_HTTP_NO_CONTENT - || r->headers_out.status == NGX_HTTP_CREATED || r != r->main || (r->method & NGX_HTTP_HEAD)) { @@ -64,7 +65,14 @@ ngx_http_chunked_header_filter(ngx_http_request_t *r) r->keepalive = 0; } else { - r->chunked = 1; + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + + if (clcf->chunked_transfer_encoding) { + r->chunked = 1; + + } else { + r->keepalive = 0; + } } } |
