#220: wip fix add wildcard server to all addr

This commit is contained in:
Timshel 2024-10-25 20:55:23 +02:00
parent f45c2707ea
commit ff99d98f9a

View File

@ -1252,14 +1252,15 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
addr = port->addrs.elts;
for (i = 0; i < port->addrs.nelts; i++) {
ngx_int_t exact_match = 1;
if (ngx_cmp_sockaddr(lsopt->sockaddr, lsopt->socklen,
addr[i].opt.sockaddr,
addr[i].opt.socklen, 0)
!= NGX_OK)
{
continue;
for (i = 0; i < port->addrs.nelts; i++) {
if ( ngx_cmp_sockaddr(lsopt->sockaddr, lsopt->socklen, addr[i].opt.sockaddr, addr[i].opt.socklen, 0) != NGX_OK ) {
if( !lsopt->wildcard ){
continue;
}
} else {
exact_match = NGX_OK;
}
/* the address is already in the address list */
@ -1379,6 +1380,9 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
addr[i].opt.quic = quic;
#endif
}
if ( exact_match == NGX_OK ){
return NGX_OK;
}