Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 8032:2025aae94739
Upstream: all known headers in u->headers_in are linked lists now.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 30 May 2022 21:25:46 +0300 |
parents | d26db4f82d7d |
children | 2bf7792c262e |
comparison
equal
deleted
inserted
replaced
8031:d26db4f82d7d | 8032:2025aae94739 |
---|---|
4608 | 4608 |
4609 ph = (ngx_table_elt_t **) ((char *) &r->upstream->headers_in + offset); | 4609 ph = (ngx_table_elt_t **) ((char *) &r->upstream->headers_in + offset); |
4610 | 4610 |
4611 if (*ph == NULL) { | 4611 if (*ph == NULL) { |
4612 *ph = h; | 4612 *ph = h; |
4613 h->next = NULL; | |
4613 } | 4614 } |
4614 | 4615 |
4615 return NGX_OK; | 4616 return NGX_OK; |
4616 } | 4617 } |
4617 | 4618 |
4630 { | 4631 { |
4631 ngx_http_upstream_t *u; | 4632 ngx_http_upstream_t *u; |
4632 | 4633 |
4633 u = r->upstream; | 4634 u = r->upstream; |
4634 | 4635 |
4636 h->next = NULL; | |
4635 u->headers_in.content_length = h; | 4637 u->headers_in.content_length = h; |
4636 u->headers_in.content_length_n = ngx_atoof(h->value.data, h->value.len); | 4638 u->headers_in.content_length_n = ngx_atoof(h->value.data, h->value.len); |
4637 | 4639 |
4638 return NGX_OK; | 4640 return NGX_OK; |
4639 } | 4641 } |
4645 { | 4647 { |
4646 ngx_http_upstream_t *u; | 4648 ngx_http_upstream_t *u; |
4647 | 4649 |
4648 u = r->upstream; | 4650 u = r->upstream; |
4649 | 4651 |
4652 h->next = NULL; | |
4650 u->headers_in.last_modified = h; | 4653 u->headers_in.last_modified = h; |
4651 u->headers_in.last_modified_time = ngx_parse_http_time(h->value.data, | 4654 u->headers_in.last_modified_time = ngx_parse_http_time(h->value.data, |
4652 h->value.len); | 4655 h->value.len); |
4653 | 4656 |
4654 return NGX_OK; | 4657 return NGX_OK; |
4814 { | 4817 { |
4815 ngx_http_upstream_t *u; | 4818 ngx_http_upstream_t *u; |
4816 | 4819 |
4817 u = r->upstream; | 4820 u = r->upstream; |
4818 u->headers_in.expires = h; | 4821 u->headers_in.expires = h; |
4822 h->next = NULL; | |
4819 | 4823 |
4820 #if (NGX_HTTP_CACHE) | 4824 #if (NGX_HTTP_CACHE) |
4821 { | 4825 { |
4822 time_t expires; | 4826 time_t expires; |
4823 | 4827 |
4854 { | 4858 { |
4855 ngx_http_upstream_t *u; | 4859 ngx_http_upstream_t *u; |
4856 | 4860 |
4857 u = r->upstream; | 4861 u = r->upstream; |
4858 u->headers_in.x_accel_expires = h; | 4862 u->headers_in.x_accel_expires = h; |
4863 h->next = NULL; | |
4859 | 4864 |
4860 #if (NGX_HTTP_CACHE) | 4865 #if (NGX_HTTP_CACHE) |
4861 { | 4866 { |
4862 u_char *p; | 4867 u_char *p; |
4863 size_t len; | 4868 size_t len; |
4913 ngx_int_t n; | 4918 ngx_int_t n; |
4914 ngx_http_upstream_t *u; | 4919 ngx_http_upstream_t *u; |
4915 | 4920 |
4916 u = r->upstream; | 4921 u = r->upstream; |
4917 u->headers_in.x_accel_limit_rate = h; | 4922 u->headers_in.x_accel_limit_rate = h; |
4923 h->next = NULL; | |
4918 | 4924 |
4919 if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_LIMIT_RATE) { | 4925 if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_LIMIT_RATE) { |
4920 return NGX_OK; | 4926 return NGX_OK; |
4921 } | 4927 } |
4922 | 4928 |
4993 { | 4999 { |
4994 ngx_http_upstream_t *u; | 5000 ngx_http_upstream_t *u; |
4995 | 5001 |
4996 u = r->upstream; | 5002 u = r->upstream; |
4997 u->headers_in.connection = h; | 5003 u->headers_in.connection = h; |
5004 h->next = NULL; | |
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 { |
5013 { | 5020 { |
5014 ngx_http_upstream_t *u; | 5021 ngx_http_upstream_t *u; |
5015 | 5022 |
5016 u = r->upstream; | 5023 u = r->upstream; |
5017 u->headers_in.transfer_encoding = h; | 5024 u->headers_in.transfer_encoding = h; |
5025 h->next = NULL; | |
5018 | 5026 |
5019 if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len, | 5027 if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len, |
5020 (u_char *) "chunked", 7 - 1) | 5028 (u_char *) "chunked", 7 - 1) |
5021 != NULL) | 5029 != NULL) |
5022 { | 5030 { |
5033 { | 5041 { |
5034 ngx_http_upstream_t *u; | 5042 ngx_http_upstream_t *u; |
5035 | 5043 |
5036 u = r->upstream; | 5044 u = r->upstream; |
5037 u->headers_in.vary = h; | 5045 u->headers_in.vary = h; |
5046 h->next = NULL; | |
5038 | 5047 |
5039 #if (NGX_HTTP_CACHE) | 5048 #if (NGX_HTTP_CACHE) |
5040 | 5049 |
5041 if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_VARY) { | 5050 if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_VARY) { |
5042 return NGX_OK; | 5051 return NGX_OK; |