Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2012-07-17 08:47:34 +0400
committerRuslan Ermilov <ru@nginx.com>2012-07-17 08:47:34 +0400
commit1fd21c48bb29cdce8147f0fb53b2ad02a6130104 (patch)
tree3881f9f7183e6fe78a050a6401b10cca0298e835 /src/http/ngx_http.c
parente30a8f90fcb67f4ff8b0163d550149019f52802b (diff)
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.
Diffstat (limited to 'src/http/ngx_http.c')
-rw-r--r--src/http/ngx_http.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 3e077fb95..f1f8a48e0 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -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;