mirror of
https://github.com/nginx/nginx.git
synced 2024-12-04 13:59:00 +08:00
Upstream: Transfer-Encoding header processing.
This commit is contained in:
parent
2da36b30c3
commit
4686f30a0c
@ -91,6 +91,9 @@ static ngx_int_t ngx_http_upstream_process_buffering(ngx_http_request_t *r,
|
||||
ngx_table_elt_t *h, ngx_uint_t offset);
|
||||
static ngx_int_t ngx_http_upstream_process_charset(ngx_http_request_t *r,
|
||||
ngx_table_elt_t *h, ngx_uint_t offset);
|
||||
static ngx_int_t
|
||||
ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r,
|
||||
ngx_table_elt_t *h, ngx_uint_t offset);
|
||||
static ngx_int_t ngx_http_upstream_copy_header_line(ngx_http_request_t *r,
|
||||
ngx_table_elt_t *h, ngx_uint_t offset);
|
||||
static ngx_int_t
|
||||
@ -247,6 +250,10 @@ ngx_http_upstream_header_t ngx_http_upstream_headers_in[] = {
|
||||
ngx_http_upstream_process_charset, 0,
|
||||
ngx_http_upstream_copy_header_line, 0, 0 },
|
||||
|
||||
{ ngx_string("Transfer-Encoding"),
|
||||
ngx_http_upstream_process_transfer_encoding, 0,
|
||||
ngx_http_upstream_ignore_header_line, 0, 0 },
|
||||
|
||||
#if (NGX_HTTP_GZIP)
|
||||
{ ngx_string("Content-Encoding"),
|
||||
ngx_http_upstream_process_header_line,
|
||||
@ -3364,6 +3371,23 @@ ngx_http_upstream_process_charset(ngx_http_request_t *r, ngx_table_elt_t *h,
|
||||
}
|
||||
|
||||
|
||||
static ngx_int_t
|
||||
ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r,
|
||||
ngx_table_elt_t *h, ngx_uint_t offset)
|
||||
{
|
||||
r->upstream->headers_in.transfer_encoding = h;
|
||||
|
||||
if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len,
|
||||
(u_char *) "chunked", 7 - 1)
|
||||
!= NULL)
|
||||
{
|
||||
r->upstream->headers_in.chunked = 1;
|
||||
}
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
|
||||
static ngx_int_t
|
||||
ngx_http_upstream_copy_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
|
||||
ngx_uint_t offset)
|
||||
|
@ -217,6 +217,7 @@ typedef struct {
|
||||
ngx_table_elt_t *location;
|
||||
ngx_table_elt_t *accept_ranges;
|
||||
ngx_table_elt_t *www_authenticate;
|
||||
ngx_table_elt_t *transfer_encoding;
|
||||
|
||||
#if (NGX_HTTP_GZIP)
|
||||
ngx_table_elt_t *content_encoding;
|
||||
@ -225,6 +226,8 @@ typedef struct {
|
||||
off_t content_length_n;
|
||||
|
||||
ngx_array_t cache_control;
|
||||
|
||||
unsigned chunked:1;
|
||||
} ngx_http_upstream_headers_in_t;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user