Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 8028:27d12017f300
Upstream: style.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 30 May 2022 21:25:40 +0300 |
parents | ef6a3a99a81a |
children | e0027c8438b0 |
comparison
equal
deleted
inserted
replaced
8027:ca78312db071 | 8028:27d12017f300 |
---|---|
4689 | 4689 |
4690 static ngx_int_t | 4690 static ngx_int_t |
4691 ngx_http_upstream_process_cache_control(ngx_http_request_t *r, | 4691 ngx_http_upstream_process_cache_control(ngx_http_request_t *r, |
4692 ngx_table_elt_t *h, ngx_uint_t offset) | 4692 ngx_table_elt_t *h, ngx_uint_t offset) |
4693 { | 4693 { |
4694 ngx_table_elt_t **ph; | 4694 ngx_table_elt_t **ph; |
4695 ngx_http_upstream_t *u; | 4695 ngx_http_upstream_t *u; |
4696 | 4696 |
4697 u = r->upstream; | 4697 u = r->upstream; |
4698 ph = &u->headers_in.cache_control; | 4698 ph = &u->headers_in.cache_control; |
4699 | 4699 |
4700 while (*ph) { ph = &(*ph)->next; } | 4700 while (*ph) { ph = &(*ph)->next; } |
4978 | 4978 |
4979 static ngx_int_t | 4979 static ngx_int_t |
4980 ngx_http_upstream_process_charset(ngx_http_request_t *r, ngx_table_elt_t *h, | 4980 ngx_http_upstream_process_charset(ngx_http_request_t *r, ngx_table_elt_t *h, |
4981 ngx_uint_t offset) | 4981 ngx_uint_t offset) |
4982 { | 4982 { |
4983 if (r->upstream->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_CHARSET) { | 4983 ngx_http_upstream_t *u; |
4984 | |
4985 u = r->upstream; | |
4986 | |
4987 if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_CHARSET) { | |
4984 return NGX_OK; | 4988 return NGX_OK; |
4985 } | 4989 } |
4986 | 4990 |
4987 r->headers_out.override_charset = &h->value; | 4991 r->headers_out.override_charset = &h->value; |
4988 | 4992 |
4992 | 4996 |
4993 static ngx_int_t | 4997 static ngx_int_t |
4994 ngx_http_upstream_process_connection(ngx_http_request_t *r, ngx_table_elt_t *h, | 4998 ngx_http_upstream_process_connection(ngx_http_request_t *r, ngx_table_elt_t *h, |
4995 ngx_uint_t offset) | 4999 ngx_uint_t offset) |
4996 { | 5000 { |
4997 r->upstream->headers_in.connection = h; | 5001 ngx_http_upstream_t *u; |
5002 | |
5003 u = r->upstream; | |
5004 u->headers_in.connection = h; | |
4998 | 5005 |
4999 if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len, | 5006 if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len, |
5000 (u_char *) "close", 5 - 1) | 5007 (u_char *) "close", 5 - 1) |
5001 != NULL) | 5008 != NULL) |
5002 { | 5009 { |
5003 r->upstream->headers_in.connection_close = 1; | 5010 u->headers_in.connection_close = 1; |
5004 } | 5011 } |
5005 | 5012 |
5006 return NGX_OK; | 5013 return NGX_OK; |
5007 } | 5014 } |
5008 | 5015 |
5009 | 5016 |
5010 static ngx_int_t | 5017 static ngx_int_t |
5011 ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r, | 5018 ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r, |
5012 ngx_table_elt_t *h, ngx_uint_t offset) | 5019 ngx_table_elt_t *h, ngx_uint_t offset) |
5013 { | 5020 { |
5014 r->upstream->headers_in.transfer_encoding = h; | 5021 ngx_http_upstream_t *u; |
5022 | |
5023 u = r->upstream; | |
5024 u->headers_in.transfer_encoding = h; | |
5015 | 5025 |
5016 if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len, | 5026 if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len, |
5017 (u_char *) "chunked", 7 - 1) | 5027 (u_char *) "chunked", 7 - 1) |
5018 != NULL) | 5028 != NULL) |
5019 { | 5029 { |
5020 r->upstream->headers_in.chunked = 1; | 5030 u->headers_in.chunked = 1; |
5021 } | 5031 } |
5022 | 5032 |
5023 return NGX_OK; | 5033 return NGX_OK; |
5024 } | 5034 } |
5025 | 5035 |