From da6332fa98b2821453ed010697dcbd254db3991b Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 7 Jun 2010 09:19:10 +0000 Subject: merge r3412, r3485: *) allow a chunked body for 201 responses *) chunked_transfer_encoding --- src/http/modules/ngx_http_chunked_filter_module.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/http/modules') 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; + } } } -- cgit