comparison src/core/ngx_inet.c @ 4970:ed2219d58518

Fixed URL parsing code. The URL parsing code is not expected to initialize port from default port when in "no_resolve" mode. This got broken in r4671 for the case of IPv6 literals.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 17 Dec 2012 09:44:46 +0000
parents 2efa05bbbc1e
children eaf95350d75c
comparison
equal deleted inserted replaced
4969:2efa05bbbc1e 4970:ed2219d58518
826 u->port_text.len = len; 826 u->port_text.len = len;
827 u->port_text.data = port; 827 u->port_text.data = port;
828 828
829 } else { 829 } else {
830 u->no_port = 1; 830 u->no_port = 1;
831
832 if (!u->no_resolve) {
833 u->port = u->default_port;
834 sin6->sin6_port = htons(u->default_port);
835 }
831 } 836 }
832 } 837 }
833 838
834 len = p - host; 839 len = p - host;
835 840
846 return NGX_ERROR; 851 return NGX_ERROR;
847 } 852 }
848 853
849 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { 854 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
850 u->wildcard = 1; 855 u->wildcard = 1;
851 }
852
853 if (u->no_port) {
854 u->port = u->default_port;
855 sin6->sin6_port = htons(u->default_port);
856 } 856 }
857 857
858 u->family = AF_INET6; 858 u->family = AF_INET6;
859 u->naddrs = 1; 859 u->naddrs = 1;
860 860