comparison src/http/ngx_http_upstream.c @ 4123:0ee350b5177c

Upstream: Transfer-Encoding header processing.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 15 Sep 2011 19:20:08 +0000
parents 42135dd1f0ea
children 0c30976f5bfa
comparison
equal deleted inserted replaced
4122:c7fae0daeb57 4123:0ee350b5177c
89 ngx_table_elt_t *h, ngx_uint_t offset); 89 ngx_table_elt_t *h, ngx_uint_t offset);
90 static ngx_int_t ngx_http_upstream_process_buffering(ngx_http_request_t *r, 90 static ngx_int_t ngx_http_upstream_process_buffering(ngx_http_request_t *r,
91 ngx_table_elt_t *h, ngx_uint_t offset); 91 ngx_table_elt_t *h, ngx_uint_t offset);
92 static ngx_int_t ngx_http_upstream_process_charset(ngx_http_request_t *r, 92 static ngx_int_t ngx_http_upstream_process_charset(ngx_http_request_t *r,
93 ngx_table_elt_t *h, ngx_uint_t offset); 93 ngx_table_elt_t *h, ngx_uint_t offset);
94 static ngx_int_t
95 ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r,
96 ngx_table_elt_t *h, ngx_uint_t offset);
94 static ngx_int_t ngx_http_upstream_copy_header_line(ngx_http_request_t *r, 97 static ngx_int_t ngx_http_upstream_copy_header_line(ngx_http_request_t *r,
95 ngx_table_elt_t *h, ngx_uint_t offset); 98 ngx_table_elt_t *h, ngx_uint_t offset);
96 static ngx_int_t 99 static ngx_int_t
97 ngx_http_upstream_copy_multi_header_lines(ngx_http_request_t *r, 100 ngx_http_upstream_copy_multi_header_lines(ngx_http_request_t *r,
98 ngx_table_elt_t *h, ngx_uint_t offset); 101 ngx_table_elt_t *h, ngx_uint_t offset);
245 248
246 { ngx_string("X-Accel-Charset"), 249 { ngx_string("X-Accel-Charset"),
247 ngx_http_upstream_process_charset, 0, 250 ngx_http_upstream_process_charset, 0,
248 ngx_http_upstream_copy_header_line, 0, 0 }, 251 ngx_http_upstream_copy_header_line, 0, 0 },
249 252
253 { ngx_string("Transfer-Encoding"),
254 ngx_http_upstream_process_transfer_encoding, 0,
255 ngx_http_upstream_ignore_header_line, 0, 0 },
256
250 #if (NGX_HTTP_GZIP) 257 #if (NGX_HTTP_GZIP)
251 { ngx_string("Content-Encoding"), 258 { ngx_string("Content-Encoding"),
252 ngx_http_upstream_process_header_line, 259 ngx_http_upstream_process_header_line,
253 offsetof(ngx_http_upstream_headers_in_t, content_encoding), 260 offsetof(ngx_http_upstream_headers_in_t, content_encoding),
254 ngx_http_upstream_copy_content_encoding, 0, 0 }, 261 ngx_http_upstream_copy_content_encoding, 0, 0 },
3363 return NGX_OK; 3370 return NGX_OK;
3364 } 3371 }
3365 3372
3366 3373
3367 static ngx_int_t 3374 static ngx_int_t
3375 ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r,
3376 ngx_table_elt_t *h, ngx_uint_t offset)
3377 {
3378 r->upstream->headers_in.transfer_encoding = h;
3379
3380 if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len,
3381 (u_char *) "chunked", 7 - 1)
3382 != NULL)
3383 {
3384 r->upstream->headers_in.chunked = 1;
3385 }
3386
3387 return NGX_OK;
3388 }
3389
3390
3391 static ngx_int_t
3368 ngx_http_upstream_copy_header_line(ngx_http_request_t *r, ngx_table_elt_t *h, 3392 ngx_http_upstream_copy_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
3369 ngx_uint_t offset) 3393 ngx_uint_t offset)
3370 { 3394 {
3371 ngx_table_elt_t *ho, **ph; 3395 ngx_table_elt_t *ho, **ph;
3372 3396