Core: fixed wrong indices in listening sockets compare loops.

Proper use is "ls[i]" and "nls[n]".  Previous code used it wrong in
several places, likely due to cut-n-paste errors.
This commit is contained in:
Maxim Dounin 2014-03-07 15:17:38 +04:00
parent 3dddf60850
commit 8800f0c42b

View File

@ -494,14 +494,14 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
} }
if (ngx_cmp_sockaddr(nls[n].sockaddr, nls[n].socklen, if (ngx_cmp_sockaddr(nls[n].sockaddr, nls[n].socklen,
ls[i].sockaddr, ls[n].socklen, 1) ls[i].sockaddr, ls[i].socklen, 1)
== NGX_OK) == NGX_OK)
{ {
nls[n].fd = ls[i].fd; nls[n].fd = ls[i].fd;
nls[n].previous = &ls[i]; nls[n].previous = &ls[i];
ls[i].remain = 1; ls[i].remain = 1;
if (ls[n].backlog != nls[i].backlog) { if (ls[i].backlog != nls[n].backlog) {
nls[n].listen = 1; nls[n].listen = 1;
} }
@ -532,7 +532,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
if (ls[n].deferred_accept && !nls[n].deferred_accept) { if (ls[i].deferred_accept && !nls[n].deferred_accept) {
nls[n].delete_deferred = 1; nls[n].delete_deferred = 1;
} else if (ls[i].deferred_accept != nls[n].deferred_accept) } else if (ls[i].deferred_accept != nls[n].deferred_accept)