mirror of
https://github.com/nginx/nginx.git
synced 2026-05-13 17:46:53 +00:00
Fixed sorting of listen addresses so that wildcard address is always at
the end (closes #187). Failure to do so could result in several listen sockets to be created instead of only one listening on wildcard address. Reported by Roman Odaisky.
This commit is contained in:
parent
e30a8f90fc
commit
1fd21c48bb
1 changed files with 5 additions and 0 deletions
|
|
@ -1613,6 +1613,11 @@ ngx_http_cmp_conf_addrs(const void *one, const void *two)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (second->opt.wildcard) {
|
||||
/* a wildcard address must be the last resort, shift it to the end */
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (first->opt.bind && !second->opt.bind) {
|
||||
/* shift explicit bind()ed addresses to the start */
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue