comparison src/http/ngx_http_upstream.c @ 4124:0c30976f5bfa

Upstream: Connection header processing.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 15 Sep 2011 19:21:19 +0000
parents 0ee350b5177c
children 70e1ee2307f9
comparison
equal deleted inserted replaced
4123:0ee350b5177c 4124:0c30976f5bfa
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 ngx_http_upstream_process_connection(ngx_http_request_t *r,
95 ngx_table_elt_t *h, ngx_uint_t offset);
94 static ngx_int_t 96 static ngx_int_t
95 ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r, 97 ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r,
96 ngx_table_elt_t *h, ngx_uint_t offset); 98 ngx_table_elt_t *h, ngx_uint_t offset);
97 static ngx_int_t ngx_http_upstream_copy_header_line(ngx_http_request_t *r, 99 static ngx_int_t ngx_http_upstream_copy_header_line(ngx_http_request_t *r,
98 ngx_table_elt_t *h, ngx_uint_t offset); 100 ngx_table_elt_t *h, ngx_uint_t offset);
216 offsetof(ngx_http_upstream_headers_in_t, accept_ranges), 218 offsetof(ngx_http_upstream_headers_in_t, accept_ranges),
217 ngx_http_upstream_copy_allow_ranges, 219 ngx_http_upstream_copy_allow_ranges,
218 offsetof(ngx_http_headers_out_t, accept_ranges), 1 }, 220 offsetof(ngx_http_headers_out_t, accept_ranges), 1 },
219 221
220 { ngx_string("Connection"), 222 { ngx_string("Connection"),
221 ngx_http_upstream_ignore_header_line, 0, 223 ngx_http_upstream_process_connection, 0,
222 ngx_http_upstream_ignore_header_line, 0, 0 }, 224 ngx_http_upstream_ignore_header_line, 0, 0 },
223 225
224 { ngx_string("Keep-Alive"), 226 { ngx_string("Keep-Alive"),
225 ngx_http_upstream_ignore_header_line, 0, 227 ngx_http_upstream_ignore_header_line, 0,
226 ngx_http_upstream_ignore_header_line, 0, 0 }, 228 ngx_http_upstream_ignore_header_line, 0, 0 },
3370 return NGX_OK; 3372 return NGX_OK;
3371 } 3373 }
3372 3374
3373 3375
3374 static ngx_int_t 3376 static ngx_int_t
3377 ngx_http_upstream_process_connection(ngx_http_request_t *r, ngx_table_elt_t *h,
3378 ngx_uint_t offset)
3379 {
3380 r->upstream->headers_in.connection = h;
3381
3382 if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len,
3383 (u_char *) "close", 5 - 1)
3384 != NULL)
3385 {
3386 r->upstream->headers_in.connection_close = 1;
3387 }
3388
3389 return NGX_OK;
3390 }
3391
3392
3393 static ngx_int_t
3375 ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r, 3394 ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r,
3376 ngx_table_elt_t *h, ngx_uint_t offset) 3395 ngx_table_elt_t *h, ngx_uint_t offset)
3377 { 3396 {
3378 r->upstream->headers_in.transfer_encoding = h; 3397 r->upstream->headers_in.transfer_encoding = h;
3379 3398