Klaus Demo nginx / 07db3a4
chunked_transfer_encoding Igor Sysoev 12 years ago
3 changed file(s) with 21 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4949 static ngx_int_t
5050 ngx_http_chunked_header_filter(ngx_http_request_t *r)
5151 {
52 ngx_http_core_loc_conf_t *clcf;
53
5254 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED
5355 || r->headers_out.status == NGX_HTTP_NO_CONTENT
5456 || r != r->main
6264 r->keepalive = 0;
6365
6466 } else {
65 r->chunked = 1;
67 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
68
69 if (clcf->chunked_transfer_encoding) {
70 r->chunked = 1;
71
72 } else {
73 r->keepalive = 0;
74 }
6675 }
6776 }
6877
597597 NGX_HTTP_LOC_CONF_OFFSET,
598598 offsetof(ngx_http_core_loc_conf_t, if_modified_since),
599599 &ngx_http_core_if_modified_since },
600
601 { ngx_string("chunked_transfer_encoding"),
602 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
603 ngx_conf_set_flag_slot,
604 NGX_HTTP_LOC_CONF_OFFSET,
605 offsetof(ngx_http_core_loc_conf_t, chunked_transfer_encoding),
606 NULL },
600607
601608 { ngx_string("error_page"),
602609 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
29712978 clcf->log_subrequest = NGX_CONF_UNSET;
29722979 clcf->recursive_error_pages = NGX_CONF_UNSET;
29732980 clcf->server_tokens = NGX_CONF_UNSET;
2981 clcf->chunked_transfer_encoding = NGX_CONF_UNSET;
29742982 clcf->types_hash_max_size = NGX_CONF_UNSET_UINT;
29752983 clcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT;
29762984
32143222 ngx_conf_merge_value(conf->recursive_error_pages,
32153223 prev->recursive_error_pages, 0);
32163224 ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1);
3225 ngx_conf_merge_value(conf->chunked_transfer_encoding,
3226 prev->chunked_transfer_encoding, 1);
32173227
32183228 ngx_conf_merge_ptr_value(conf->open_file_cache,
32193229 prev->open_file_cache, NULL);
362362 ngx_flag_t log_subrequest; /* log_subrequest */
363363 ngx_flag_t recursive_error_pages; /* recursive_error_pages */
364364 ngx_flag_t server_tokens; /* server_tokens */
365 ngx_flag_t chunked_transfer_encoding; /* chunked_transfer_encoding */
365366
366367 #if (NGX_HTTP_GZIP)
367368 ngx_flag_t gzip_vary; /* gzip_vary */