mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 13:43:28 -06:00
Upstream: optimize loops in ngx_http_upstream_init_round_robin().
This commit is contained in:
parent
a6b7cfe967
commit
8f3dfde7f7
@ -71,11 +71,11 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
|
||||
n = 0;
|
||||
|
||||
for (i = 0; i < us->servers->nelts; i++) {
|
||||
for (j = 0; j < server[i].naddrs; j++) {
|
||||
if (server[i].backup) {
|
||||
continue;
|
||||
}
|
||||
if (server[i].backup) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j < server[i].naddrs; j++) {
|
||||
peers->peer[n].sockaddr = server[i].addrs[j].sockaddr;
|
||||
peers->peer[n].socklen = server[i].addrs[j].socklen;
|
||||
peers->peer[n].name = server[i].addrs[j].name;
|
||||
@ -125,11 +125,11 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
|
||||
n = 0;
|
||||
|
||||
for (i = 0; i < us->servers->nelts; i++) {
|
||||
for (j = 0; j < server[i].naddrs; j++) {
|
||||
if (!server[i].backup) {
|
||||
continue;
|
||||
}
|
||||
if (!server[i].backup) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j < server[i].naddrs; j++) {
|
||||
backup->peer[n].sockaddr = server[i].addrs[j].sockaddr;
|
||||
backup->peer[n].socklen = server[i].addrs[j].socklen;
|
||||
backup->peer[n].name = server[i].addrs[j].name;
|
||||
|
Loading…
Reference in New Issue
Block a user