comparison src/http/modules/ngx_http_fastcgi_module.c @ 6785:d1d0dd69a419

Upstream: added the ngx_http_upstream_resolved_t.name field. This fixes inconsistency in what is stored in the "host" field. Normally it would contain the "host" part of the parsed URL (e.g., proxy_pass with variables), but for the case of an implicit upstream specified with literal address it contained the text representation of the socket address (that is, host including port for IP). Now the "host" field always contains the "host" part of the URL, while the text representation of the socket address is stored in the newly added "name" field. The ngx_http_upstream_create_round_robin_peer() function was modified accordingly in a way to be compatible with the code that does not know about the new "name" field. The "stream" code was similarly modified except for not adding compatibility in ngx_stream_upstream_create_round_robin_peer(). This change is also a prerequisite for the next change.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 31 Oct 2016 18:33:33 +0300
parents 1af120241cde
children 0fba3ed4e7eb
comparison
equal deleted inserted replaced
6784:1af120241cde 6785:d1d0dd69a419
767 } 767 }
768 768
769 if (url.addrs) { 769 if (url.addrs) {
770 u->resolved->sockaddr = url.addrs[0].sockaddr; 770 u->resolved->sockaddr = url.addrs[0].sockaddr;
771 u->resolved->socklen = url.addrs[0].socklen; 771 u->resolved->socklen = url.addrs[0].socklen;
772 u->resolved->name = url.addrs[0].name;
772 u->resolved->naddrs = 1; 773 u->resolved->naddrs = 1;
773 u->resolved->host = url.addrs[0].name; 774 }
774 775
775 } else { 776 u->resolved->host = url.host;
776 u->resolved->host = url.host;
777 }
778
779 u->resolved->port = url.port; 777 u->resolved->port = url.port;
780 u->resolved->no_port = url.no_port; 778 u->resolved->no_port = url.no_port;
781 779
782 return NGX_OK; 780 return NGX_OK;
783 } 781 }